Bird
0
0

What will be the output of this command if the directory contains files log1.txt, log2.txt, and notes.txt?

medium📝 Command Output Q4 of 15
Linux CLI - Searching and Finding
What will be the output of this command if the directory contains files log1.txt, log2.txt, and notes.txt?
find . -name 'log*.txt'
A./log1.txt ./log2.txt
B./notes.txt
Clog1.txt log2.txt notes.txt
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Understand the pattern 'log*.txt'

    This matches files starting with 'log' and ending with '.txt'.
  2. Step 2: Identify matching files

    Files 'log1.txt' and 'log2.txt' match; 'notes.txt' does not.
  3. Final Answer:

    ./log1.txt ./log2.txt -> Option A
  4. Quick Check:

    Pattern match output = D [OK]
Quick Trick: Use wildcards (*) to match multiple files [OK]
Common Mistakes:
  • Expecting notes.txt to match
  • Ignoring ./ prefix in output
  • Assuming no output if partial match

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes