Operator Meaning
* Matches any string including the null.
? Matches single character
[a-Z] Matches case insensitive letters a - z
[0-9a-Z] Matches case insensitive letters and numbers
**/* Matches all files and zero or more directories and subdirectories
**/** Matches only directories and subdirectories
Posix Classes
Operator Meaning
[[:alnum:]] matches alphabetic or numeric characters. This is equivalent to [A-Za-z0-9]
[[:alpha:]] matches alphabetic characters. This is equivalent to [A-Za-z]
[[:space:]] matches whitespace characters (space and horizontal tab)
[[:cntrl:]] matches control characters
[[:digit:]] matches (decimal) digits. This is equivalent to [0-9]
[[:lower:]] matches lowercase alphabetic characters. This is equivalent to [a-z]
[[:print:]] Matches characters in the range of ASCII 32 – 126 (printable characters)
[[:upper:]] matches uppercase alphabetic characters. This is equivalent to [A-Z]
[[:xdigit:]] matches hexadecimal digits. This is equivalent to [0-9A-Fa-f]
ls [[:digit:]]
grep [[:digit:]] test.file
Extended Pattern Matching
Operator Meaning
*(pattern) Matches zero or more occurrences of the given pattern
+(pattern) Matches one or more occurrences of the given pattern
?(pattern) Matches zero or one occurrence of the given pattern
@(pattern) Matches exaclty one of the given pattern
!(pattern) Matches anything except one of the given pattern
ls -d !(*.html|*gif|*jpg) # everything but .html, .jpg or ,gif files
ls file+([0-9])
# list file9, file22 but not fileit
ls -d +(apl*|un*)
# begins with apl or un only