Bird
0
0

Given files: log1.txt, log2.txt, logA.txt, logB.txt, what files will match the pattern log?.txt?

medium📝 Command Output Q4 of 15
Linux CLI - File and Directory Operations
Given files: log1.txt, log2.txt, logA.txt, logB.txt, what files will match the pattern log?.txt?
AOnly logA.txt and logB.txt
BOnly log1.txt and log2.txt
Clog1.txt, log2.txt, logA.txt, logB.txt
DNo files match
Step-by-Step Solution
Solution:
  1. Step 1: Understand ? wildcard

    The ? matches exactly one character.
  2. Step 2: Apply pattern log?.txt to files

    All files have 'log' + one character + '.txt', so all match.
  3. Final Answer:

    log1.txt, log2.txt, logA.txt, logB.txt -> Option C
  4. Quick Check:

    One character after 'log' matches all listed files [OK]
Quick Trick: ? matches exactly one character anywhere [OK]
Common Mistakes:
  • Thinking ? matches multiple characters
  • Ignoring file extensions
  • Assuming only digits match ?

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes