Bird
0
0

What will be the result of this command sequence?

medium📝 Command Output Q13 of 15
Linux CLI - Users and Groups
What will be the result of this command sequence?
useradd -m alice
userdel alice
AUser alice is deleted but home directory remains
BUser alice and home directory are deleted
CUser alice is created but deletion fails
DSyntax error occurs
Step-by-Step Solution
Solution:
  1. Step 1: Create user alice with home directory

    useradd -m alice creates user alice and a home folder.
  2. Step 2: Delete user alice without -r option

    userdel alice deletes the user but does not remove the home directory unless -r is used.
  3. Final Answer:

    User alice is deleted but home directory remains -> Option A
  4. Quick Check:

    userdel without -r keeps files [OK]
Quick Trick: userdel needs -r to remove home directory [OK]
Common Mistakes:
MISTAKES
  • Assuming home directory is deleted without -r
  • Thinking userdel fails without -r
  • Confusing useradd options with userdel

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes