File and Directory Wildcards
When you have a number of files named in
series (for example, chap1.doc to
chap12.doc) or filenames with common characters
(such as aegis, aeon, and
aerie), you can use wildcards to specify many
files at once. These special characters are *
(asterisk), ? (question mark), and [ ] (square brackets). When used in a file or directory name
given as an argument on a command line, the characteristics detailed
in Table 4-1 are true.
Table 4-1. Shell wildcards
|
Notation |
Definition |
|---|---|
* |
An asterisk
stands for any number of characters in a filename. For example,
|
? |
A
question mark stands for any single character (so
|
[] |
Square brackets can surround a
choice of single characters (i.e., one digit or one letter)
you’d like to match. For example,
|
The following examples show the use of wildcards. The first command lists all the entries ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access