Bird
0
0

What will be the output of the command find /tmp -type d -name "test" if there is a directory named test inside /tmp?

medium📝 Command Output Q13 of 15
Linux CLI - Searching and Finding
What will be the output of the command find /tmp -type d -name "test" if there is a directory named test inside /tmp?
AIt will list the full path of the directory named test inside /tmp
BIt will list all files named test inside /tmp
CIt will delete the directory named test inside /tmp
DIt will show an error because of incorrect syntax
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command options

    /tmp is the search path, -type d means only directories, -name "test" looks for name 'test'.
  2. Step 2: Predict output

    The command will print the full path of any directory named 'test' inside /tmp and its subfolders.
  3. Final Answer:

    It will list the full path of the directory named test inside /tmp -> Option A
  4. Quick Check:

    find with -type d lists directories [OK]
Quick Trick: -type d means directories only [OK]
Common Mistakes:
  • Confusing -type d with files
  • Expecting deletion instead of listing
  • Assuming syntax error without checking

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes