Tagged with: Linux wildcard character globbing
First, wildcards are a way for the shell to extend functionality. In the shell of Linux, the difference between the expressions of the wildcard wildcards regular is to be distinguished.
Simply understood, wildcard characters are used to match filenames. The regular expression is used to match the contents of the file.
To understand wildcard characters, first, you need to memorize the metacharacters in the wildcard:
*: Indicates any character that matches any length. Need to be aware of any length, including 0 length, i.e. no characters
? : Matches an arbitrary character that matches only one character
Range Matching:
[0-9]: Indicates a matching number
[A-Z]: Indicates a matching lowercase letter
[A-Z]: indicates matching uppercase letters
Range matching Inverse:
[^0-9]: Indicates a match to a non-numeric
[^a-z]: Indicates matching non-lowercase letters
[^a-z]: Indicates a match to a non-uppercase letter
Special Matching method:
[[: Space:]]: Indicates matching whitespace characters
[[:p UNCT:]]: Indicates matching punctuation
[[:d Igit:]]: Indicates a matching number
[[: Lower:]]: Indicates a matching lowercase letter
[[: Upper:]]: Indicates matching uppercase letters
[[: Alpha:]]: Indicates matching letters, not case sensitive
[[: Alnum:]]: Indicates a matching alphanumeric number.
The special matching method also supports inversion, which is reversed as follows:
[^[::]]
A summary of the use of Linux wildcard characters