Basic command:
LS Displays files and directories in the current directory
Ls-l Listing File Details l-list
LS-A lists all files and directories in the current directory, including Hidden A-all
mkdir Creating a Directory
-P Create directory, if no parent directory, create p-parent for example, you want to create a git directory under the work directory in the current directory, but the current directory does not have a work directory, use mkdir work/git one step to create
CD Switch Directory
Touch creates an empty file
Echo creates a file with content
Cat View File Contents
CP Copy, copy
MV Move or rename
RM Delete File
-R Recursive Delete, can delete subdirectories and files
-F Force Delete
Find search files in file system
WC statistics Text line number, word count, number of characters
Grep finds a string in a text file
RmDir Delete Empty Directory
Tree structure display directory, need to install tree package
PWD Displays the full path of the current directory
LN creates a linked file
More, less pagination displays text file contents
Head, tail display file header, tail content
CTRL + ALT + F1 command line full screen mode
System administration Commands:
Stat Displays details of the specified file, more detailed than LS
Who shows online login users
WHOAMI Show current Operation user
Hostname Display host name
Uname Display System Information
Top dynamic display currently consumes the most resources process information
PS Display transient process status Ps-aux
Du view directory size Du-h/home with units display directory information
DF View disk size df-h with unit display disk information
Ifconfig Viewing network conditions
Ping Test network connectivity
Netstat Displaying network status information
Man view Command Manual (usage), e.g. man ls
Clear Clear Screen
Alias Rename the command, alias such as: Alias showmeit= "Ps-aux", in addition to de-use Unaliax Showmeit
Packaging Compression Related commands:
Tar: Packaging compression
-C Archive File
-X Compressed file
-Z gzip Compressed file
-j bzip2 Compressed Files
-V shows the compression or decompression process V (view)
-F Use file name
Cases:
TAR-CVF/HOME/ABC.TAR/HOME/ABC only packaged, not compressed
TAR-ZCVF/HOME/ABC.TAR.GZ/HOME/ABC packaged and compressed with gzip
TAR-JCVF/HOME/ABC.TAR.BZ2/HOME/ABC packaged and compressed with bzip2
Of course, if you want to decompress, just replace the above command TAR-CVF/TAR-ZCVF/TAR-JCVF "C" in the "X".
Shutdown/Restart machine:
Shutdown
-R shutdown Restart
-H shutdown does not restart
Now turn the machine off.
Halt shut down the machine
Reboot restart
Linux Common commands