The most common Linux commands and tools
Directory Next document: CD name
Return to the previous directory: CD.
To view and edit a text file:
? View files: More, tail
? Edit File: VI
such as scripting. SH
VI shell.sh
To view system network status:
? View System Status: Top
? View network Status: Netstat
? View Network configuration: ifconfig
System processes:
Search: Ps–ef | grep "string"
: Ps-fu "string"?
Kill: Kill-9 <PID>
File, directory operations:
Catalog: mkdir, CD, pwd?
If you create a name:mkdir/tmp/name under the TMP directory
Create, copy, delete, view: Vi,cp,rm,ls?
Copy: CP destination File Destination Cp/tmp/name.tar.gz/tmp/name
Permissions: Chmod,chown?
chmod 777 Name.tar.gz
Looking for: Find,grep?
The current directory finds files with the specified string? Grep–rn "string". ? ?
Locate the file with the specified string under the specified directory:? find/var-type f-mount |xargs fgrep-l "PHP"
Package Compression and unpacking:
? [[email protected] ~]# tar-cvf/tmp/etc.tar/etc <== only packaged, not compressed!? [[email protected] ~]# tar-zcvf/tmp/etc.tar.gz/etc <== packaged, compressed with gzip
? [[email protected] src]# Tar-xvf/tmp/etc.tar unpack the package without compression? [[email protected] src]# tar-zxvf/tmp/etc.tar.gz uncompressed
Such as: The contents of the/OPT directory compressed into the work number lisun.tar.gz
Tar-zcvf/tmp/lisun.tar.gz/opt
While[[]]
Do
Touch $name 1$name2.txt
Done
For (())
Do
Done
Pass parameters
Read name
Shell script Shallow in