Bird
0
0

Why does this command fail to show any output?

medium📝 Debug Q7 of 15
Linux CLI - Users and Groups
Why does this command fail to show any output?
grep '^user:' /etc/shadow
AUser 'user' does not exist in /etc/shadow
BFile /etc/shadow is empty
CIncorrect grep syntax
DPermission denied reading /etc/shadow
Step-by-Step Solution
Solution:
  1. Step 1: Understand /etc/shadow permissions

    /etc/shadow is readable only by root or privileged users.
  2. Step 2: Running grep without sudo causes permission denied

    Without sudo, grep cannot read /etc/shadow, so no output appears.
  3. Final Answer:

    Permission denied reading /etc/shadow -> Option D
  4. Quick Check:

    Permission denied = no output [OK]
Quick Trick: Use sudo to read /etc/shadow or get permission denied [OK]
Common Mistakes:
  • Assuming user does not exist
  • Thinking grep syntax is wrong
  • Assuming /etc/shadow is empty

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes