Wildcard characters
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 (?).
Valid wildcard characters that you can use include:
- *
- Asterisk. Matches zero or more characters.
- ?
- Question mark. Matches any single character at the present position.
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 |
Important: Use an asterisk (*) instead of a question mark
(?) as a wildcard character when trying to match a pattern on a multibyte
code page, to avoid unexpected results.
Note: In batch mode, enclose
values containing wildcards in quotation marks. Otherwise, UNIX shells expand unquoted wildcards,
and it is easy to exceed the 20 operand limit. It is more efficient
to let the client process wildcard file specifications because many
fewer server interactions are needed to complete the task. For example:
dsmc selective "/home/me/*.c"