Multiple choice

Which of the following wildcards is used to match a single character in a shell command?

  1. *

  2. ?

  3. [ijk]

  4. [!ijk]

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The ? wildcard in UNIX shell matches exactly one character in a filename or pattern. For example, file?.txt would match file1.txt, fileA.txt but not file12.txt or file.txt. The * wildcard matches multiple characters.