The wildcard characters are special characters in Linux, and they are used to specify a group (class) of characters. Table 13 lists all the Linux wildcards:
Wildcard | What it does |
* | Matches any character(s). |
? | Matches any single character. |
[characters] | Matches the characters that are members of the set characters. For example, [abc] will match the characters a, b, or c. |
[!characters] | Matches any character that is not a member of the set characters. It is basically the negation of [characters]. For example, [!abc] will match any character that is not a, b, or c. |
[[:class:]] | Matches any character that is a member of the character class. |
Table 13: Linux wildcards
You have already seen character classes before when we were discussing the tr command. Remember [:lower:] and [:upper:] represent lower and upper case letters, these are two examples of character classes. Table 14 lists the most common character classes:
Character Class | What it represents |