click below
click below
Normal Size Small Size show me how
LPI101 - table 5-3
Common file-naming wildcards
Question | Answer |
---|---|
* | Commonly thought to "match anything," it actually will match zero or more characters (which includes "nothing"!). For example, x* matches files or directories x, xy, xyz, x.txt, xy.txt, xyz.c, and so on. |
? | Match exactly one character. For example, x? matches files or directories xx, xy, xz, but not x and not xyz. The specification x?? matches xyz, but not x and xy. |
[characters] | Match any single character from among characters listed between the brackets. For example, x[yz] matches xy and xz. |
[!characters] | Match any single character other than characters listed between the brackets. For example, x[!yz] matches xa and x1 but does not match xy or xz. |
[a-z] | Match any single character from among the range of characters listed between the brackets and indicated by the dash (the dash character is not matched). For example, x[0-9] matches x0 and x1, but does not match xx. Note that to match both upper- and lower |
[!a-z] | Match any single character from among the characters not in the range listed between the brackets. |
{frag1,frag2,frag3,...} | Create strings frag1, frag2, frag3, etc. For example, file_{one,two,three} yields the strings file_one, file_two, and file_three. This is a special operator named brace expansion that can be used to match filenames but isn't specifically a file wildcard o |