Recall & Review
beginner
What does the
useradd command do in Linux?The
useradd command creates a new user account on the system. It sets up the user's home directory, default shell, and other settings.Click to reveal answer
beginner
What is the purpose of the
userdel command?The
userdel command deletes a user account from the system. It can also remove the user's home directory and files if used with the right options.Click to reveal answer
intermediate
How do you create a user with a specific home directory using
useradd?Use
useradd -d /path/to/home username. The -d option sets the home directory for the new user.Click to reveal answer
intermediate
What option with
userdel removes the user's home directory and mail spool?The
-r option deletes the user's home directory and mail spool along with the user account: userdel -r username.Click to reveal answer
beginner
Why should you be careful when using
userdel -r?Because it permanently deletes the user's home directory and files. If important data is there, it will be lost. Always back up if needed.
Click to reveal answer
Which command creates a new user account in Linux?
✗ Incorrect
useradd is used to create new user accounts.What does the
-r option do with userdel?✗ Incorrect
The
-r option deletes the user account and the user's home directory.How do you specify a custom home directory when adding a user?
✗ Incorrect
The
-d option sets the home directory path.Which command deletes a user account but keeps the home directory?
✗ Incorrect
userdel username deletes the user but leaves the home directory intact.What should you do before running
userdel -r?✗ Incorrect
Backing up files prevents data loss since
-r deletes user files.Explain how to add a new user with a custom home directory and then delete that user including their files.
Think about the options that control home directory and file removal.
You got /2 concepts.
Describe the risks of using
userdel -r and how to avoid them.Consider what happens to user data when deleting accounts.
You got /3 concepts.