Bird
0
0

Which of the following is the correct wildcard pattern to match files named exactly test1, test2, or test3?

easy📝 Syntax Q3 of 15
Linux CLI - File and Directory Operations
Which of the following is the correct wildcard pattern to match files named exactly test1, test2, or test3?
Atest{1,2,3}
Btest?
Ctest*
Dtest[123]
Step-by-Step Solution
Solution:
  1. Step 1: Understand character classes []

    Square brackets match exactly one character from the set inside.
  2. Step 2: Analyze test[123]

    This matches test followed by one character which is 1, 2, or 3.
  3. Final Answer:

    test[123] -> Option D
  4. Quick Check:

    Character class [] matches one from set [OK]
Quick Trick: Use [] to match one character from a set [OK]
Common Mistakes:
  • Using {} which is not a glob wildcard
  • Using * which matches too many files
  • Using ? which matches any single character

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes