Bird
0
0

You run wc -l file.txt but get an error: wc: invalid option -- 'x'. What is the likely cause?

medium📝 Debug Q14 of 15
Linux CLI - Viewing and Editing Files
You run wc -l file.txt but get an error: wc: invalid option -- 'x'. What is the likely cause?
AThe file <code>file.txt</code> does not exist
BYou forgot to specify the filename
CYou typed an invalid option like <code>-x</code> by mistake
DThe <code>wc</code> command is not installed
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the error message

    The error says "invalid option -- 'x'", meaning wc received an option -x which it does not recognize.
  2. Step 2: Identify common causes

    This usually happens if you mistype an option, for example -x instead of -l or -w.
  3. Final Answer:

    You typed an invalid option like -x by mistake -> Option C
  4. Quick Check:

    Invalid option error means wrong flag [OK]
Quick Trick: Check option spelling carefully if wc shows invalid option error [OK]
Common Mistakes:
MISTAKES
  • Confusing file not found with invalid option error
  • Assuming missing filename causes invalid option error
  • Ignoring typo in command options

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes