Bird
0
0

Which command will display the contents of two files named file1.txt and file2.txt one after the other?

easy📝 Conceptual Q2 of 15
Linux CLI - Viewing and Editing Files
Which command will display the contents of two files named file1.txt and file2.txt one after the other?
Acat > file1.txt file2.txt
Bcat file1.txt > file2.txt
Ccat file1.txt file2.txt
Dcat -d file1.txt file2.txt
Step-by-Step Solution
Solution:
  1. Step 1: Understand how cat handles multiple files

    The cat command can take multiple filenames and display their contents sequentially.
  2. Step 2: Identify the correct syntax to display both files

    Using cat file1.txt file2.txt will print the contents of file1.txt followed by file2.txt.
  3. Final Answer:

    cat file1.txt file2.txt -> Option C
  4. Quick Check:

    Multiple files with cat = list files in order [OK]
Quick Trick: List files after cat to show all contents [OK]
Common Mistakes:
MISTAKES
  • Using redirection incorrectly
  • Adding invalid options like -d
  • Misplacing > operator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes