Bird
0
0

You run ls -lh but get an error: 'ls: invalid option -- h'. What is the likely cause?

medium📝 Debug Q6 of 15
Linux CLI - Navigating the File System
You run ls -lh but get an error: 'ls: invalid option -- h'. What is the likely cause?
AMissing a space between options
BTyping -lh instead of -hl
CUsing an old ls version without -h support
DRunning ls in a non-Linux system
Step-by-Step Solution
Solution:
  1. Step 1: Check option validity

    -h is a valid option in modern ls versions for human-readable sizes.
  2. Step 2: Identify error cause

    Error suggests the ls version is old and does not support -h.
  3. Final Answer:

    Using an old ls version without -h support -> Option C
  4. Quick Check:

    Invalid option error = old ls version [OK]
Quick Trick: Update ls to support -h for human-readable sizes [OK]
Common Mistakes:
MISTAKES
  • Thinking option order matters
  • Assuming missing space causes error
  • Ignoring system compatibility

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes