Common command statistics for Linux systems and Shell special characters

Source: Internet
Author: User

Shell special characters: 1. Wildcard character 2. Piping

1. Wildcard characters

1.1 asterisk (*): matches any length

1.2 Question mark (? ): Matches a length of characters

1.3 square brackets ([...] ): matches the character specified in it

1.4 Square brackets ([-]): matches a specified range of characters

1.5 square brackets ([^ ...] ): matches except for the characters specified therein

2. Piping |

A pipeline can link multiple commands, such as the output of the first command as input to the second command

2.1WC command

EG:WC Log.txt

Result:2 4 6 Log.txt are a few lines, how many words, how many bytes

Eg:ls/usr/bin | Wc-w Query the number of files in the bin directory

2.2grep command

Eg:grep "lolors"/etc/passwd query lolors account information

3. Input and output redirection

3.1;: Greater than number is new mode

eg:> file_name redirect file_name to the output source for new mode

3.2 >>: for Append mode

3.3 <: input source redirection

Eg:wc<file1 will file1 in the content to do statistics, generally omitted <

3.4 2> or &> directs the error message generated by the command to the specified file

Eg:ls-l Noexist_app 2> Error.txt

2> can only save error messages,&> You can save the correct information and save the error message.

2>> and &>> for Append mode

Common command statistics for Linux systems and Shell special characters

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.