Bird
0
0

What is the correct command syntax to compare two files named report1.log and report2.log using diff?

easy📝 Syntax Q3 of 15
Linux CLI - Viewing and Editing Files
What is the correct command syntax to compare two files named report1.log and report2.log using diff?
Adiff -c report1.log report2.log
Bdiff report1.log report2.log
Cdiff -r report1.log report2.log
Ddiff -u report1.log report2.log
Step-by-Step Solution
Solution:
  1. Step 1: Identify basic syntax

    The basic syntax to compare two files is diff file1 file2.
  2. Step 2: Understand options

    Options B and D add context or unified format, which are optional. diff -r report1.log report2.log is for recursive directory comparison.
  3. Final Answer:

    diff report1.log report2.log -> Option B
  4. Quick Check:

    Basic diff syntax is diff file1 file2 [OK]
Quick Trick: Basic diff syntax: diff file1 file2 [OK]
Common Mistakes:
  • Using directory options for files
  • Adding unnecessary flags for simple comparison

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes