1. The ls command uses three time sorts
2.Motd color settings
3. Soft connection
4. In addition to the location of the CD, the location of the GPG public key: /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6,
5.yum provides file(rpm -qf file)
6.!?wc
7. When compiling and installing, pay attention to manually adding the PATH variable. Before installing the software, read the README file and the INSTALL file.
8. Use yum grouplist to view available package groups, group installation # yum groupinstall "Development Tools" Package groups related to compilation and development
9. The yum cache path /var/cache/yum stores the cache files installed by yum. If keepcache=1 is specified, the rpm package installed by yum will be retained
10. Use ctrl+insert to copy shift+insert paste in Xshell
11. The MakeFile.in file in the software source package is the template file of MakeFile
12. The configure file in the source package of the software can be used as the reference source code for learning shell scripts, # cat configure example shell script, you can refer to learning
13. PREFIX is the general folder, it is easy to delete the software after designation, --sysconfdir=/etc independent etc configuration folder
14. The default of the disable option displayed in ../configure is enabled, otherwise it is disabled
15. When there are many options in ../configure, you can add \ to a new line and pay attention to having a space before \. It is recommended to paste it after editing the notebook.
16. yum list *openssl* View the list of packages containing openssl
17.make -j 4 4 is the number of CPU cores of the virtual machine, the parallel compilation speed is fast, but the number of cores needs to be adjusted
18. Be careful to read INSTALL, which contains the command to start the service (httpd: apachectl start)
19. When compiling and installing, pay attention to adding the PATH variable to facilitate the startup of the running service
20.vi /etc/selinux/config (SElinux configuration file) (vi /etc/sysconfig/selinux is a file link)
setenforce 0
21. One-click installation script: centos6 compile and install httpd2.2.34, centos7 httpd2.4.25
22. The missing package for compilation and installation is likely to be the ***-devel-** package
Curl http://testsrv//install.sh | bash can edit the content of the script into the webpage and use curl to remotely execute the shell script in the webpage
File location: /var/www/html/install.sh
23. When the man help document is not available during compilation and installation, you need to add the location of the man help in the man configuration file (/etc/man.config|man_db.conf)
Centos7:/etc/man_db.conf
#MANDATORY_MANPATH /usr/src/pvm3/man
#
MANDATORY_MANPATH /usr/man
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/share/man
Centos6:/etc/man.config
# Every automatically generated MANPATH includes these fields
#
MANPATH /usr/man
MANPATH /usr/share/man
MANPATH /usr/local/man
MANPATH /usr/local/share/man
MANPATH /usr/X11R6/man
24. Typical two character files /dev/zero /dev/null
[root@centos6 yum]# ll /dev/zero /dev/null
crw-rw-rw-. 1 root root 1, 3 Apr 13 14:49 /dev/null
crw-rw-rw-. 1 root root 1, 5 Apr 13 14:49 /dev/zero
25.mknod /data/sdA b 8 1 Create a device file (cp -a /dev/sda /app/sdb, note that the -a option must be used, the -p option cannot be used, and the contents of the disk are copied when the option is not applicable)
26.mknod /data/zerofile c 1 5 (same as /dev/zero master and slave device number) same as /dev/zero after creation
dd if=/data/zerofile of=...
27.sda sdb sdc In linux, multiple disks are numbered in the manner of sda, sdb, sdc..., and the partitions of the disk are distinguished by sda1, sda2,...
28. SATA is the interface for home computer hard disks, and the hard disk interface for SAS servers
29. lsblk View block device and partition information, note that lsblk views the block device information in memory, while fdisk -l views the partition information on the disk, and sometimes needs the partition information in memory and on the disk
30. Centos6 will change when adding a hard disk, try not to use the name of sd* in the configuration file
31. Primary partition 1-4, logical partition starts from 5
32. track (track), the outer track number is 0, and the fixed sector is 512 bytes. It is unreasonable to allocate the same number of sectors to each track. Now the number of sectors allocated to the outer layer is more than the innermost track. However, the calculation of the partition size in the Linux operating system still uses the assumption that the inner and outer tracks are the same number of sectors.
Centos6:
Disk /dev/sda: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008cf29
echo 13054*255*63*512/1000/1000/1000|bc (note that the size of a single sector is 512 bytes: Sector size (logical/physical): 512 bytes / 512 bytes)
Centos7:(fdisk -l)
Disk /dev/sda: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00025eb8
echo 209715200*512/1000/1000/1000 |bc uses the number of sectors to divide the disk space
The number of 6bit storage sectors of 33.6bit track, a total of 64 sectors, 0 sector has special use (MBR) 8bit head number
34.fdisk -l
echo 512*63*1024*255/1024/1024|bc
Cylinders are used in Centos6 to divide partitions, while sectors are already used in Centos7 to divide partitions
35.CHS 8G(max) LBR supports larger capacity
36.1. Partition 2. Create File System: Format 3. Mount: Assign Directory Name
37.hexdump -C /dev/sdb |less is all 0, 1 binary data
38.vim ctrl+v+{ to edit the ^[ in the text
/etc/motd file content:
^[[1;31mHi,Dangerous !^[[0m
echo -e '\e[1;31m Hi,Dangerous! \e[0m'
Summary: The color font ^[ in the text is represented by \e when using the echo -e option
39. There are 4 main partitions and extended partitions, 3 main partitions and one extended partition
40. The significance of the partition is that the file system can be installed later, which is convenient for data management on the disk, including the use of files, and the ability to set permissions to log in.
41.hexdump -C /dev/sda -n 512 Specify the number of bytes to view the MBR partition information
42.1 cylinders is about 8M, calculate fdisk -k
43. After centos7, the disk space is divided by sectors, not by cylinders (before centos6)
44.centos7 divides disk space in sectors (fdisk -l), centos6 divides disk space by cylinder
45.dd if=/dev/sda of=/data/mbr_bak bs=1 count=512 512 bytes of backup MBR
46.lsblk, cat /proc/partitions, ls/dev/sda* all view the partition table in memory, only # fdisk -l view the partition table information in the hard disk
47.dd if=/data/mbr_bak of=/dev/sda recovery
48.scp 192.168.30.100:/data/mbr_bak . Copy remote files to local
49.ifconfig ens33 192.168.30.100/24 up set ip address
50. The logical partition is in EBR, use dd if=dev/sda of=/dev/sdd to backup the partition
51.dd if=/dev/....skip=510 seek=510
52 hexdump -C .. -n 512 -v -v Display detailed information, do not omit the same bytes to display
53.fdisk -l / dev / sda
54.parted with immediate effect and careful use
55. Single maximum partition 2T (MBR)
56. fdisk lsblk is out of sync, use partprobe
57.partx -a /dev/sda centos6 uses this command to synchronize newly added partitions, and use partx -d -nr 6-8 /dev/sda to delete partitions
58.fdisk uses the partition table ls /dev/sda* of the hard disk and the rest are in memory
59.centos6 partprobe can only use partx -a /dev/sda (used in the scenario of adding partitions, adding multiple partitions can also identify them all)
When deleting a partition, partx -d -nr 6-8 /dev/sda 6-8 indicates 6, 7, 8, 3 disk spaces
60.centos7 can directly use partprobe to reread the partition table
61. Pay attention to the partition error if there is a small space gap when partitioning the disk. The default partition is the small space disk gap, so there will be problems when dividing large partitions
62. Check the types of file systems supported by the system: /lib/modules/3.10.0-693.el7.x86_64/kernel/fs
63. The file system with log function will facilitate power failure recovery
The reason why 64.ls and other external parts can directly interact with the underlying file system without the restriction of the file system type is because there is a layer of virtual file system between the user space and the file system
65. The difference between buffer and cache is that one is for write operation and the other is for read operation
66.blkid /dev/sda1 Check whether the file system is installed
/dev/sda1: UUID="1149b172-88e6-48b4-8c46-dfbd598a6cba" TYPE="xfs"
67.uuidgen generates uuid, it is best to use uuid number to identify the device, do not use the name of /dev/sda to prevent changes
68.mkfs -t ext4 /dev/sdb1(mkfs.ext4)
69.df -T displays mounted, unmounted file systems can use # blkid
70.tune2fs -l /dev/sdb1 View the characteristics of the file system (only ext series)
71.tune2fs -o acl /dev/sdb1 Add acl permissions for manually created partitions (centos6), centos7 has acl permissions when manually creating partitions, no need to manually add
72. What fsck fixes is the logical error of the file system
73. Block is the smallest unit of file allocation, which is different from the 1k block of fdisk -l