Bird
0
0

Given a file file.txt with content:

medium📝 Command Output Q4 of 15
Linux CLI - Viewing and Editing Files
Given a file file.txt with content:
Hello
World
What is the output of wc -l file.txt?
A3 file.txt
B1 file.txt
C0 file.txt
D2 file.txt
Step-by-Step Solution
Solution:
  1. Step 1: Count lines in the file

    The file has two lines: "Hello" and "World".
  2. Step 2: Understand -l option output

    wc -l outputs the number of lines followed by the filename.
  3. Final Answer:

    2 file.txt -> Option D
  4. Quick Check:

    Line count = 2 [OK]
Quick Trick: Count newline characters for lines with -l [OK]
Common Mistakes:
  • Counting words instead of lines
  • Ignoring newline at end of file
  • Assuming line count is zero

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes