Body
test Data
Touch a a6.log abc.log ac.txt b c C5.txt X.log a
"*"
Represents any number of characters
Example: Query with ". Log" end of file
ll *.log
"?"
Represents any single character
For example: Only query A, B, C
ll?
"[]"
Represents a character between "[" and "]", for example, [0-9] can represent any number between 0-9, [a-za-z] can represent any letter between a-Z and a-Z, and the letters are case-sensitive.
Example: Only query the alphabetic file
ll [a-za-z]
Example: The query ends with ". Log" and a file with only two characters before ". Log" and the second character is the number
ll? [ 0-9].log
"^"
Indicates the meaning of the match result, note that this wildcard must be used in []
Example: A query is not a file that ends with ". Log"
ll *[^txt]*
"{}"
To represent multiple files contained within parentheses
Example: File
ll {*.log,*.txt} at the end of query '. Log ' and '. txt '
Note: "." This is particularly true if the matching condition adds the match so that the query result file contains the band "." of the file
Example of the preceding "^", if I query "ll *." [^txt]*], then the result is not the same
Delete Operation
For example: Delete A, B, C, and files ending with. txt
rm-f {[Abc],*.txt}
Summary
Of course, if you can query, of course, you can also use wildcard matching to move the file, if you need to move certain types of files in a folder where there are many files, the efficiency of using wildcard matching is obvious; At that time, the use of wildcard characters is not only these, there is free to study more.