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