Bird
0
0

You want to recursively compare two directories projectA and projectB, ignoring all differences in whitespace. Which diff command should you use?

hard📝 Application Q8 of 15
Linux CLI - Viewing and Editing Files
You want to recursively compare two directories projectA and projectB, ignoring all differences in whitespace. Which diff command should you use?
Adiff -r -w projectA projectB
Bdiff -r -i projectA projectB
Cdiff -w projectA projectB
Ddiff -q projectA projectB
Step-by-Step Solution
Solution:
  1. Step 1: Understand options

    -r enables recursive directory comparison; -w ignores all whitespace differences.
  2. Step 2: Evaluate options

    diff -r -i projectA projectB ignores case (-i), not whitespace. diff -w projectA projectB lacks recursion. diff -q projectA projectB only reports if files differ, no details.
  3. Final Answer:

    diff -r -w projectA projectB -> Option A
  4. Quick Check:

    Use -r for recursion and -w to ignore whitespace [OK]
Quick Trick: Use -r for recursion and -w to ignore whitespace [OK]
Common Mistakes:
MISTAKES
  • Using -i instead of -w to ignore whitespace
  • Omitting -r for recursive directory comparison

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes