Bird
0
0

What will be the output of the command sudo whoami if run by a normal user?

medium📝 Command Output Q13 of 15
Linux CLI - Users and Groups
What will be the output of the command sudo whoami if run by a normal user?
Aroot
Bsudo
Cnormal user name
DPermission denied
Step-by-Step Solution
Solution:
  1. Step 1: Understand what whoami does

    whoami prints the current user's name.
  2. Step 2: Effect of sudo on whoami

    Running sudo whoami runs the command as root, so it prints root.
  3. Final Answer:

    root -> Option A
  4. Quick Check:

    sudo changes user to root for command [OK]
Quick Trick: sudo runs command as root user [OK]
Common Mistakes:
MISTAKES
  • Expecting normal username output
  • Thinking sudo prints 'sudo'
  • Assuming permission denied without sudo

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes