goelweb.com --> Software --> Unix utilities --> Unix shell --> Shell Pattern Matching Rules

Shell Pattern Matching Rules

*
match any string, including the null string
?
match any single character
[ccc]
match any of the characters in ccc. [a-d0-3] is equivalent to [abcd0123]
"..."
match ... exactly; quotes protect special characters. Also '...'
\c
match c literally
a|b
in case expressions only, matches either a or b
/
in filenames, matched only by an explicit / in the expression; in case, matched like any other character
.
as the first character of a filename, is matched only by an explicit . in the expression
rishi.goel@alumni.usc.edu