TestOut Linux Pro Practice Test 2025 – All-in-One Guide to Master Your Certification!

Question: 1 / 400

What command is used to delete a user and their home directory?

userdel -r

The command used to delete a user and their home directory is `userdel -r`. When you use `userdel` to remove a user account from the system, the `-r` option specifically instructs the command to also remove the user's home directory and its contents. This is a crucial feature because simply deleting the user account without this option would leave behind the user's files, which could take up unnecessary space and create potential security issues.

In comparison, the other commands provided do not serve the same purpose. The `usermod` command is utilized for modifying user accounts, not for deleting them. The option `userdel -f` forcefully deletes a user account, but it does not remove the user's home directory unless combined with the `-r` option. The option "deactivate user" is not a recognized command in standard Linux systems for removing users. Hence, `userdel -r` is the correct answer for ensuring that both the user account and their associated home directory are completely removed from the system.

Get further explanation with Examzify DeepDiveBeta

usermod -r

userdel -f

deactivate user

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy