① managing Linux
W View the current system load
/proc/cpuinfo Saving server CPU related information
Grep-c ' processor '/proc/cpuinfo Compute server CPU Count
Vmstats Monitoring System Status
Top Displays the system resources that the process occupies
SAR Monitoring System Status
Sar-n DEV View network card traffic
Xargs the output of other commands as input to subsequent commands
Find./-mtime +10 | Xargs RM
Find *.txt | xargs-n1-i{} mv {} {}_bak
Modify all files with the suffix. txt. txt_bak;-n1 to represent an object to handle;-i{} means to replace each object with {}
-exec is often used in combination with find
Find./*-exec mv {} {}_bak \; Add the file name of the file under the current directory _bak;{} to represent each file object
Nohup do not hang up Run command
Nohup SH task.sh &
Sometimes even if the script is running in the background, when the user exits the login, the script exits, and after using the Nohup command, the script will continue to run without hanging up.
tar [-ZJXCVFPP] File
-Z gzip compression-j bzip2 compression-X unpack or unzip-T view the contents of the TAR package-C build a tar package or zip file Package-V Visualization
-F compression with the file name to indicate the name of the package, extract the file name to extract the files, if there is-F, write F to the last
-P Reserved Source file Property-P can use absolute path--exclude filename Extract do not say filename file included
Gzip Compression Tool
gzip [-d#] File
Compressed file, the suffix will become file.gz;-d used during decompression;-#表示压缩等级, #值在1-9, 1 worst, 9 best, default 6;gzip not available to compress directory
bzip2 [-dz] File
-D user decompression;-Z for compression, can be omitted; As with gzip, you cannot compress a directory
Syntax knowledge for shell Scripts 3