Bird
0
0

If a file test.txt contains the text:

medium📝 Command Output Q5 of 15
Linux CLI - Viewing and Editing Files
If a file test.txt contains the text:
Hi there
How are you?
What will wc -w test.txt output?
A3 test.txt
B4 test.txt
C6 test.txt
D5 test.txt
Step-by-Step Solution
Solution:
  1. Step 1: Count words in the file

    Words are: Hi, there, How, are, you? Total 5 words.
  2. Step 2: Understand -w output format

    wc -w outputs word count followed by filename.
  3. Final Answer:

    5 test.txt -> Option D
  4. Quick Check:

    Word count = 5 [OK]
Quick Trick: Count words separated by spaces with -w [OK]
Common Mistakes:
  • Counting lines instead of words
  • Miscounting punctuation as separate words
  • Ignoring last word

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes