Bird
0
0

Which command correctly switches to user mary and initiates a login shell session?

easy📝 Syntax Q3 of 15
Linux CLI - Users and Groups
Which command correctly switches to user mary and initiates a login shell session?
Asu mary -l
Bsu - mary
Csu --login mary
Dsu mary
Step-by-Step Solution
Solution:
  1. Step 1: Understand the login shell option

    The - option with su starts a login shell, loading the user's environment.
  2. Step 2: Analyze options

    su - mary is the standard syntax to switch to user mary with a login shell.
    su mary -l and su --login mary are not valid syntax.
    su mary switches user but does not start a login shell.
  3. Final Answer:

    su - mary -> Option B
  4. Quick Check:

    Check for the dash (-) after su for login shell [OK]
Quick Trick: Use 'su - username' for login shell [OK]
Common Mistakes:
  • Using 'su username' without '-' does not start a login shell
  • Assuming 'su username -l' is valid syntax
  • Confusing options order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes