This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.
Note: The Knowledge Base search does not permitwildcards.
A wildcard is a symbol that takes the place of an unknown character orset of characters. Commonly used wildcards are the asterisk(*) and the question mark (?). Depending onthe software or the search engine you are using, other wildcardcharacters may be defined.
When you are searching for files in Unix, DOS,or Windows, or on the web, you can simplify your search by using awildcard. Wildcards may also simplify commands issued from thecommand line in Unix or DOS.
The asterisk (*)
The asterisk represents any number of unknown characters. Use it whensearching for documents or files for which you have only partialnames.
For example, if you enter cheese*
as your search term,the search might return these items:
cheese cheesecake cheesedip.txt
If you enter *cheese
as your search term, the searchmight return these items:
stringcheese swisscheese sliced.cheese
For Unix or DOS, you can use the wildcard search in the command lineto list all the files with a particular extension. For example, if youwant to find all the files that end with .old
, in DOS youcould enter your search as follows:
dir *.old
Or, in Unix, you could enter:
ls *.old
For most web search engines, wildcards increase the number of yoursearch results. For example, if you enter running
as thesearch term, the search will return only documents with that oneword. If you search using run*
, the search resultsmay contain run
, runner
, andrunning
.
The question mark (?)
The question mark represents only one unknown character. Use it whenyou have a list of files with very similar names, or when you areunsure of a few characters.
For example, if you enter take?.txt
as your search term,the search might return these files:
take1.txt taken.txt take2.txt
However, it would not find take12.txt
because thequestion mark only covers one character. To find two unknowncharacters, enter take??.txt
as your search term.
Combining * and ?
You can use the asterisk (*) and the question mark(?) anywhere in a search, and you can also use themtogether. For example, if you want to find all the files that startwith home
, followed by one or two characters, and endingwith any extension, enter home??.*
as your searchterm. Your search might return home45.bak
orhomer4.txt
, but not homeloan.doc
.