Bird
0
0

Which of the following best describes the function of the diff command in Linux?

easy📝 Conceptual Q1 of 15
Linux CLI - Viewing and Editing Files
Which of the following best describes the function of the diff command in Linux?
AIt deletes duplicate lines from a file.
BIt merges two files into one by combining their contents.
CIt compares the contents of two files line by line to show differences.
DIt compresses files to save disk space.
Step-by-Step Solution
Solution:
  1. Step 1: Understand diff's purpose

    The diff command is designed to compare files line by line.
  2. Step 2: Eliminate incorrect options

    Options B, C, and D describe other commands or functions unrelated to diff.
  3. Final Answer:

    It compares the contents of two files line by line to show differences. -> Option C
  4. Quick Check:

    diff shows line-by-line differences [OK]
Quick Trick: diff compares files line by line [OK]
Common Mistakes:
MISTAKES
  • Confusing diff with merge or compression commands
  • Thinking diff modifies files instead of comparing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes