Basic commands for Linux

Source: Internet
Author: User
Tags clear screen create directory parent directory

Common directives
ls???? show files or directories
???-l????? List file details L (list)
???? to list all files and directories under the current directory, including Hidden A (all)
Mkdir???? Create a Directory
???-P????? Create directory, if no parent directory, create p (parent)
Cd??????? Switch directories
Create an empty file with touch????
echo?????? Create a file with content.
Cat??????? View File Contents
cp????????
Mv??????? Move or rename
Rm??????? deleting files
??????????????, delete subdirectories and files
???-F??????
Search for a file in the file system with find??????
The number of rows, words, and characters in the statistics text of a WC????????
Grep?????? Find a string in a text file
RmDir????? Delete Empty Directory
Tree?????? Tree structure display directory, need to install tree package
Pwd??????? show current Directory
Create a linked file in ln?????????
More, less? pagination Displays text file contents
Head, tail? show file header, tail content
Ctrl+alt+f1? command line full-screen mode
System administration Commands
The details of the specified file are shown in more detail than LS.
Who??????? Show online Login User
WhoAmI????? show current Action user
Hostname??? Display host Name
Uname????? Display System Information
Top???????? Dynamic display currently consumes the most resources process information
ps.???????? show transient process status Ps-aux
View directory size Du-h/home with units display directory information.
DF????????? To view disk size df-h with unit display disk information
Ifconfig????? view network conditions
Ping???????? Test network connectivity
Netstat????? Display Network status information
Man????????? such as: Man ls
Clear??????? Clear screen
Alias??????? Rename the command as: Alias showmeit= "Ps-aux", in addition to de-use Unaliax Showmeit
Kill???????? To kill a process, you can first use the PS or top command to view the process ID, and then kill the process with the kill command.
Packaging compression-related commands
Gzip:
BZIP2:
Tar:???????? Packaging compression
???-C??????? Archive files
???????????? Compressed files
???-Z??????? gzip Compressed Files
-j??????. bzip2 Compressed Files
???-V??????? show compression or decompression process V (view)
??????????? Use file name
Cases:
Tar-cvf/home/abc.tar/home/abc??????? package only, do not compress
Tar-zcvf/home/abc.tar.gz/home/abc????, packed and compressed with gzip
TAR-JCVF/HOME/ABC.TAR.BZ2/HOME/ABC, packaged and compressed with bzip2
Of course, if you want to decompress, replace the above command directly? TAR-CVF? /TAR-ZCVF? /TAR-JCVF "C" to "X".
Shut down/Restart the machine
Shutdown
???-r?????? Power off restart
???-H?????? Shutdown does not restart
Turn off the computer at once.
Halt??????? Shutdown
Reboot????? restart
Linux Pipelines
Use the standard output of one command as the standard input for another command. That is, the combination of several commands to use, the latter command in addition to the results of a previous command.
Example: Grep-r "Close"/home/* | More??? Locate all files in the home directory, including the close file, and page out.

Basic commands for Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.