When using the command line, there is a lot of time to find the files you need, such as LS found. S H e l L provides a complete set of string pattern matching rules, or as a meta character, when S H e l L encounters these characters, they are treated as special characters instead of ordinary characters in the file name, so that they can be used to match the corresponding file names, which I understand to be called wildcard characters.
Wildcard characters are different from regular expressions, in a nutshell: Wildcards are used to match strings, and regular expressions are used for string literals, and in text filtering tools, regular expressions, such as awk,sed, and so on, are intended for the contents of a file. Wildcard characters are used in file names, such as looking for FIND,LS,CP, and so on. Second, the Shell's wildcard character differs from the regular expression, and the "" is generally a wildcard (the shell itself is extracted), and "is generally a regular expression (the shell passes data from it to other commands)."
The following are the common wildcard characters:
* matches any string in the filename, including an empty string.
。 Matches any single character in the file name.
[...] Matches any character contained in [].
[!...] Match [] non-exclamation point. After the characters.
Such as:
All strings beginning with 5* 5
All strings at the end of *5 5
*5. A string with 5 as the penultimate character
[0-9] All with a number of characters
[1,2] 1 or 2
[!0-9] is not a character of a number
ls/etc/[!a-n]*.conf lists files in the/etc/directory that do not start with the letter A through n, and end with. conf
ls/etc/[a-n]*.conf lists files that start with the letter A through n in the/etc/directory and end With. conf
ls/bin/[ck]* lists filenames that start with C or K
If there are any irregularities, please correct me.
Reference: http://bbs.lupaworld.com/thread-38881-1-1.html