Bird
0
0

Identify the error in this command: sudo -u root ls /root

medium📝 Debug Q6 of 15
Linux CLI - Users and Groups
Identify the error in this command: sudo -u root ls /root
AMissing password prompt
BIncorrect use of -u option
CNo error, command is correct
DRoot user cannot run ls
Step-by-Step Solution
Solution:
  1. Step 1: Understand sudo -u usage

    -u root runs command as root user explicitly.

  2. Step 2: Check command correctness

    ls /root lists root's home directory. This is valid with sudo.

  3. Final Answer:

    No error, command is correct -> Option C
  4. Quick Check:

    sudo -u root runs command as root [OK]
Quick Trick: sudo -u specifies user to run command as [OK]
Common Mistakes:
MISTAKES
  • Thinking -u is invalid
  • Expecting password in command
  • Assuming root can't run ls

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes