As a system administrator, you need to remove a user's account from a Linux system. The user's account, 'johndoe', must be deleted along with the user's home directory and mail spool. Which command should you use to accomplish this task?
The command userdel -r johndoe will remove the user 'johndoe' and delete the user's home directory as well as the mail spool. The -r option stands for 'remove' and is used specifically for this purpose. Simply using userdel johndoe would not remove the home directory or mail spool. deluser and removeuser are not standard Linux commands. It is essential to use the correct options and command to ensure proper cleanup of user accounts.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the -r option in the userdel command do?
Open an interactive chat with Bash
What is the difference between userdel and deluser commands?
Open an interactive chat with Bash
Why is it important to remove a user's home directory and mail spool?