Bird
0
0

You ran ls -l /etc/passwd but got "ls: cannot access '/etc/passwd': No such file or directory". What should you check first?

medium📝 Debug Q7 of 15
Linux CLI - Linux Basics and Terminal
You ran ls -l /etc/passwd but got "ls: cannot access '/etc/passwd': No such file or directory". What should you check first?
AIf you typed <code>ls</code> correctly
BIf you have root permissions
CIf the file /etc/passwd exists
DIf the terminal is connected to the internet
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error

    The error says the file does not exist or path is wrong.
  2. Step 2: Check file existence

    Verify if /etc/passwd is present; permissions or internet are unrelated.
  3. Final Answer:

    If the file /etc/passwd exists -> Option C
  4. Quick Check:

    Check file presence on error [OK]
Quick Trick: Verify file exists before listing it [OK]
Common Mistakes:
  • Assuming permission error
  • Checking internet connection unnecessarily
  • Thinking ls syntax is wrong

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes