Bird
0
0

You run grep -r 'TODO' /project but get an error saying 'No such file or directory'. What is the likely cause?

medium📝 Debug Q6 of 15
Linux CLI - Text Processing
You run grep -r 'TODO' /project but get an error saying 'No such file or directory'. What is the likely cause?
AThe directory /project does not exist
BThe grep command does not support -r
CThe pattern 'TODO' is invalid
DYou need to use sudo with grep
Step-by-Step Solution
Solution:
  1. Step 1: Understand error message

    'No such file or directory' means the specified path does not exist or is incorrect.
  2. Step 2: Check other options

    grep -r is valid, pattern 'TODO' is valid, and sudo is not required for this error.
  3. Final Answer:

    The directory /project does not exist -> Option A
  4. Quick Check:

    Missing directory causes 'No such file' error [OK]
Quick Trick: Check directory path exists before recursive grep [OK]
Common Mistakes:
  • Assuming grep lacks -r support
  • Blaming pattern syntax
  • Forgetting to verify directory existence

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes