Bird
0
0

You want to compare two directories dir1 and dir2 recursively to find all file differences. Which diff command should you use?

hard📝 Application Q15 of 15
Linux CLI - Viewing and Editing Files
You want to compare two directories dir1 and dir2 recursively to find all file differences. Which diff command should you use?
Adiff -c dir1 dir2
Bdiff -r dir1 dir2
Cdiff dir1 dir2
Ddiff -i dir1 dir2
Step-by-Step Solution
Solution:
  1. Step 1: Understand recursive comparison

    The -r option tells diff to compare directories recursively.
  2. Step 2: Check other options

    -c is context output, not recursive. No option means file comparison only. -i ignores case, not recursive.
  3. Final Answer:

    diff -r dir1 dir2 -> Option B
  4. Quick Check:

    Recursive directory diff [OK]
Quick Trick: Use -r to compare directories recursively with diff [OK]
Common Mistakes:
  • Using -c expecting recursion
  • Omitting -r for directory comparison
  • Confusing -i with recursive option

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes