Bird
0
0

Why does su - start a login shell while su alone does not?

hard📝 Conceptual Q10 of 15
Linux CLI - Users and Groups
Why does su - start a login shell while su alone does not?
ABecause su without dash requires sudo privileges
BBecause su without dash uses the current user's environment
CBecause su - runs commands as root always
DBecause the dash tells su to simulate a full login environment
Step-by-Step Solution
Solution:
  1. Step 1: Understand the dash option meaning

    The dash - tells su to start a login shell, loading the target user's environment as if logging in fresh.
  2. Step 2: Compare behavior without dash

    Without dash, su switches user but keeps the current environment, not simulating a full login.
  3. Final Answer:

    Because the dash tells su to simulate a full login environment -> Option D
  4. Quick Check:

    Dash means full login shell [OK]
Quick Trick: Dash means full login environment load [OK]
Common Mistakes:
  • Thinking su - always runs as root
  • Confusing environment preservation
  • Assuming sudo is required

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes