Shell Metacharacters for File-Name Substitution | |
* | matches zero or more characters of any type |
? | matches exactly one character of any type |
[] | matches any single character listed within the brackets. You can use a dash to specify a range of characters, for instance a-z. |
[!c] | if the first character listed inside the brackets is '!', it matches any single character that is NOT in the brackets. |
ls [Aa]??.*[0-9]
Matches any files starting with 'A' or 'a', followed by any two characters followed by '.' followed by anything else and ending with a numeric digit 0 thru 9. For example will match the following files: Ab2.9 alt.txt9 Aaa.123 a_..Z12b7
echo *
echo '*'
echo \*