Glob extension
In the path extension in the shell, there are several glob involved:
? Match any single character
* Match 0 to more characters
[Set] matches any one of the characters in the set, such as [0-9], matches any number
[!set] matches any character that is not in set, such as [!0-9], matches any non-numeric character
It is important to note that:
In set-based glob, if you want to match-, you can put-in front of the set, or placed behind the set, such as [-a0-9] matches any character-,a,0 to 9;
If you want to match!, you need to escape
If the match is unsuccessful, the original string is preserved, such as LS g*, and if the match cannot be made, the shell will error: g* No such file or directory
Brace extension
1 Basic formats for brace extensions
preamble{comma-delimited string}postscript, where premable and PostScript are optional, such as:
A{b, C}d, extended to ABD,ACD
2 brace extensions can be nested
A{b{c,d},e}f, extended to ABCF,ABDF,AEF
3 brace extensions can be used to represent a contiguous set of letters or numbers:
{0..4} extended to 0 1 2 3 4
The above glob extension and brace extension, both of which can be used in the shell's path extension
Path expansion in the shell