Summary of common linux commands and parameters (basic) and common linux commands

Source: Internet
Author: User

Summary of common linux commands and parameters (basic) and common linux commands

1. user's home directory (~) In linux, users all have their own home directories. you can place your own configuration files and other things. pwd: list the current directory. optional parameter-P: when the current directory is a link directory, the real path is displayed. ls: List Files And Directories: optional parameter:-a: List all files, including hidden files, that is, files with dots (.) -l: list file details-S: Sort files and directories from large to small-r: Sort files and directories from small to large-t: list objects and directories based on the last modification time. ln: create a link file. optional parameter:-f: When a link file already exists, force re-create a link file-s: Create a soft link file, similar to the windows shortcut, if the s parameter is not set, a hard-link file is created by default, and only files can be linked, but directories cannot be linked. A hard link is equivalent to creating another file, the only difference between the two files is that deleting the source file does not affect the linked file. The soft link file is a value that points to the source file. When the source file is deleted, the source file cannot be found. cd: Change directory 6. mkdi R: create directory: optional parameter:-p: allows us to create a nested directory, such as mkdir a/B/c-v: display the creation result 7. copy: copy file: Note: if multiple files are copied, the last parameter must be the destination directory. optional parameter:-R: copy directory-v: copy result-I: in general, if the target file exists during replication, it will overwrite. If this parameter exists, ask whether to overwrite 8. rm: delete file: Description: When deleting an empty directory, use rm-d <directory>. If there is a file in the directory, use rm-r <directory> to forcibly delete a file or directory, rm-rf <delete file> 9. mv: Move a file or rename a file Description: if the original address and destination address of the file are the same, rename 10. |: Pipeline command: Pass the result of the preceding command to the next command for processing, such as listing all files, only filter out specific files ls-a | grep "specific files" 11. >>>, <, <: Redirection Description:>,> redirect the output. For example, ls> a.txt redirects The result is redirected to A. txt (ls> A. txt) and the result is redirected to A. txt. However, the content of the original file is not cleared in the append mode. <: Enter redirection. For example, when a command needs to be input, you can read the input from the file <: The content between the start tag and the end tag is used as the input. A common method of Writing File Content

Cat> a.txt <EOF
Hello, world
EOF
The lifecycle command will write hello, world in the.txt File

 

Related Article

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.