Bird
0
0

Which of the following is the correct syntax to display the contents of a file named notes.txt using cat?

easy📝 Syntax Q12 of 15
Linux CLI - Viewing and Editing Files
Which of the following is the correct syntax to display the contents of a file named notes.txt using cat?
Acat notes.txt
Bcat -f notes.txt
Ccat > notes.txt
Dcat -r notes.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify the basic syntax of cat

    The basic command to display a file is cat filename, so cat notes.txt is correct.
  2. Step 2: Understand incorrect options

    -f and -r are not valid options for cat. The cat > filename syntax is used to create or overwrite a file, not display it.
  3. Final Answer:

    cat notes.txt -> Option A
  4. Quick Check:

    Basic syntax is cat filename [OK]
Quick Trick: Use just 'cat filename' to show file content [OK]
Common Mistakes:
MISTAKES
  • Adding invalid options like -f or -r
  • Using > which overwrites files
  • Confusing cat with other commands

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes