Shell Basics (2)

Source: Internet
Author: User

Special symbols in the 1.linux shell
(1) "*" represents 0 or more arbitrary symbols
(2) "? "represents only one arbitrary symbol
(3) "#" comment Description, "#" after the content will be ignored
(4) "\" caret character, "\" After the special symbol will be restored normal symbol
(5) "|" Pipe character, with the preceding input as the following input

2. Command cut: intercepts a field
Usage: cut/etc/passwd |cut-d ': '-F 1 |head
Format: cut-d ' delimited character ' [-CF] n N represents a number
-D: followed by the assigned character
-C: followed by the first few letters
-F: The next section is followed by the number of blocks


3. Command sort: Sort
Usage: sort-t:-kn1-n
Format: Sort [-t delimiter] [-KN1,N2] [-nru]



4. Command WC: Statistics
-L (number of rows)-m (characters)-W (number of words)

5. Command uniq: Delete duplicate rows
Usage: uniq-c
6. Command Tee:tee followed by the file name, the files are written to the following file display
Usage: | Tee file name
7. Command tr: Replacement character
-D: Delete a character followed by the character you want to delete
-S: Remove duplicate characters

8. Command split: Cutting documents
-B: Cutting documents according to size
-L: Number of rows cutting document

9. Special symbol $: Last variable in "!$" command

10. Special symbols ";" : Multiple commands can be run in a row

11. Special symbol: "~" User home Directory

12. Special symbol: "&" to run the command in the background

13. REDIRECT symbol: ">" ">>" "2>" "2>>"
">" ">>" represents "Replace" "append" respectively
14. Special symbols: []

15. Special symbols: "&&" "| |"
"&&" when used, only after the successful execution of the previous, the subsequent execution
"| |" When used, no matter the previous execution is unsuccessful, the following execution

20180604

Shell Basics (2)

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.