Bird
0
0

What will be the output of the following commands if you run su - bob and enter the correct password?

medium📝 Command Output Q13 of 15
Linux CLI - Users and Groups
What will be the output of the following commands if you run su - bob and enter the correct password?
whoami
Aroot
BPermission denied
Ccurrent user name
Dbob
Step-by-Step Solution
Solution:
  1. Step 1: Understand what su - bob does

    This command switches the current user to 'bob' and loads his environment after password verification.
  2. Step 2: Check the output of whoami

    After switching, whoami shows the current active user, which will be 'bob'.
  3. Final Answer:

    bob -> Option D
  4. Quick Check:

    After su, whoami = new user [OK]
Quick Trick: whoami shows switched user after su [OK]
Common Mistakes:
MISTAKES
  • Expecting root instead of target user
  • Thinking it shows original user
  • Assuming permission denied without password

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes