Pattern matching using the * wildcard character
Use the asterisk (*
) to match any sequence or
string of characters.
The (
*
) indicates any characters, including no characters.See
the following examples:
- If you have the following files in your directory:
and you want to refer to only the files that begin with1test 2test afile1 afile2 bfile1 file file1 file10 file2 file3
file
, use:
The files selected would be: file, file1, file10, file2, and file3.file*
- To refer to only the files that contain the word
file
, use:
The files selected would be: afile1, afile2, bfile1, file, file1, file10, file2, and file3.*file*