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?
AYou forgot to add a directory path
BThe -l option cannot be combined with -h
CYou need to use uppercase H instead of lowercase h
DYour system's ls version does not support -h option
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error message

    The error says -h is invalid, meaning the ls version likely does not support it.
  2. Step 2: Check compatibility

    Older or minimal ls versions may lack -h (human-readable sizes). It's not about missing path or option conflicts.
  3. Final Answer:

    Your system's ls version does not support -h option -> Option D
  4. Quick Check:

    Unsupported option error = Version lacks feature [OK]
Quick Trick: Check ls version if options cause errors [OK]
Common Mistakes:
  • Assuming missing path causes error
  • Trying uppercase H
  • Thinking -l and -h conflict

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes