Bird
0
0

What will be the output of this command if you run it as user bob?

medium📝 Command Output Q5 of 15
Linux CLI - Users and Groups
What will be the output of this command if you run it as user bob?
su -c 'whoami' alice
Abob
Balice
Croot
Dcommand not found
Step-by-Step Solution
Solution:
  1. Step 1: Understand su -c 'command' username syntax

    The command runs as the specified user, here alice.
  2. Step 2: Recognize whoami output

    whoami prints the current user running the command, so it will print alice.
  3. Final Answer:

    alice -> Option B
  4. Quick Check:

    su -c 'cmd' user runs cmd as user [OK]
Quick Trick: Use su -c 'cmd' user to run command as user [OK]
Common Mistakes:
  • Thinking it runs as current user
  • Confusing command placement
  • Expecting root output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes