R. Craig Collins >
ITSC 1305 > Wildcards
Wildcards © R. Craig Collins, 2005/7
A wildcard can be used when a DOS command should be applied to multiple files.
*, the asterisk (computer people call it star)
can mean anything, or nothing, and range over multiple characters
in a filename.
?, the question mark
can mean something, for a specific character position in a filename.
If you have the following files If you use a wildcard in the source you must use the same wildcard pattern in the destination. |
If you have the following files If you use a wildcard in the source you must use the same wildcard pattern in the destination. |
If you have the following files If you use a wildcard in the source you must use the same wildcard pattern in the destination. |
More detailed examples
Scenario: |
If you wished to select any file, as long as it ends with
.txt you would use: If you wished to select any txt file, as long as it starts with file
you would use: |
| Scenario: A:\ file.txt file1.txt file2.txt file3.txt file4.txt file10.txt fred.txt file.doc file1.doc file2.doc file3.doc file4.doc file10.doc fred.doc |
If you wished to select any file, as long as it starts with the letters
file you would use: but not |
| Scenario: A:\ file.txt file1.txt file2.txt file3.txt file4.txt file10.txt fred.txt file.doc file1.doc file2.doc file3.doc file4.doc file10.doc fred.doc |
If you wished to select any text file, as long as it includes a single
digit number you would use: If you wished to select any file, with any
extension, (all) you would use: |