File-naming wildcards

Wildcards (also called file globs) allow the specification of many files at once. A list of commonly used wildcards can be found in Table 10-4.

Table 10-4. File-naming wildcards

Wildcard

Function

*

Match zero or more characters.

?

Match exactly one character.

[characters]

Match any single character from among characters listed between brackets.

[!characters]

Match any single character other than characters listed between brackets.

[a-z]

Match any single character from among the range of characters listed between brackets.

[!a-z]

Match any single character from among the characters not in the range listed between brackets.

{frag1,frag2,frag3,...}

Brace expansion: create strings frag1, frag2, and frag3, etc., such that file_{one,two,three} yields file_one, file_two, and file_three.

Get LPI Linux Certification in a Nutshell, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.