Use wildcard characters when you want to specify multiple files with similar names in one command. Without wildcard characters, you must repeat the command for each file.
In a command, you can use wildcard characters in the file name or file extension only. You cannot use them to specify destination files, file systems, or server names. You cannot specify a directory whose name contains an asterisk (*) or a question mark (?).
The following table shows examples of each wildcard.
Pattern | Matches | Does not match |
---|---|---|
Asterisk (*) | ||
ab* | ab, abb, abxxx | a, b, aa, bb |
ab*rs | abrs, abtrs, abrsrs | ars, aabrs, abrss |
ab*ef*rs | abefrs, abefghrs | abefr, abers |
abcd.* | abcd.c, abcd.txt | abcd, abcdc, abcdtxt |
Question Mark (?) | ||
ab? | abc | ab, abab, abzzz |
ab?rs | abfrs | abrs, abllrs |
ab?ef?rs | abdefjrs | abefrs, abdefrs, abefjrs |
ab??rs | abcdrs, abzzrs | abrs, abjrs, abkkkrs |
dsmc selective "/home/me/*.c"