In the terminal, several wildcards can be used to match file and directory names. Here are the most common ones:
-
Asterisk (
*): Matches any number of characters (including none).- Example:
*.txtmatches all.txtfiles.
- Example:
-
Question Mark (
?): Matches exactly one character.- Example:
file?.txtmatchesfile1.txt,fileA.txt, but notfile.txt.
- Example:
-
Square Brackets (
[]): Matches any one of the enclosed characters.- Example:
file[1-3].txtmatchesfile1.txt,file2.txt, andfile3.txt.
- Example:
-
Exclamation Mark (
!): Used inside square brackets to negate a match.- Example:
file[!1].txtmatchesfile2.txt,file3.txt, but notfile1.txt.
- Example:
These wildcards can help you efficiently search for files and directories based on patterns. If you have more questions or need further clarification, feel free to ask!
