Bird
0
0

Given files: file1.txt, file2.txt, fileA.txt, fileB.txt, what files does the pattern file?.txt match?

medium📝 Command Output Q13 of 15
Linux CLI - File and Directory Operations
Given files: file1.txt, file2.txt, fileA.txt, fileB.txt, what files does the pattern file?.txt match?
A<code>file1.txt, file2.txt</code>
B<code>file1.txt, file2.txt, fileA.txt, fileB.txt</code>
C<code>fileA.txt, fileB.txt</code>
D<code>file.txt</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand the pattern file?.txt

    The ? matches exactly one character, so it matches any file named 'file' plus one character plus '.txt'.
  2. Step 2: Check which files match

    All files with names 'file1.txt', 'file2.txt', 'fileA.txt', and 'fileB.txt' have exactly one character after 'file' before '.txt', so all match.
  3. Final Answer:

    file1.txt, file2.txt, fileA.txt, fileB.txt -> Option B
  4. Quick Check:

    ? matches exactly one character [OK]
Quick Trick: Use ? to match exactly one character [OK]
Common Mistakes:
MISTAKES
  • Thinking ? matches zero or multiple characters
  • Confusing ? with *
  • Ignoring file extension in pattern

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes