Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

LPI 102-500 Exam - Topic 7 Question 115 Discussion

Actual exam question for LPI's 102-500 exam
Question #: 115
Topic #: 7
[All 102-500 Questions]

What is true regarding the command userdel --force --remove bob? (Choose TWO correct answers.)

Show Suggested Answer Hide Answer
Suggested Answer: A, B

The command userdel --force --remove bob is used to delete the user account named bob and all its associated files. The --force option forces the removal of the user account, even if the user is still logged in.The --remove option forces userdel to remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user12. Therefore, options A and B are true regarding this command.

The other options are not true because:

Option C is false because the locate database is not updated by the userdel command.The locate database is updated by the updatedb command, which is usually run by cron as a scheduled job3.

Option D is false because the userdel command does not remove all files owned by bob from all mounted filesystems. The userdel command only removes the user's home directory and mail spool, and it does not search for and delete the user files located in other file systems.You have to search for and delete the files manually1.

Option E is false because the userdel command does not delete the group with the same name as the user, unless the USERGROUPS_ENAB parameter is set to yes in the /etc/login.defs file and the group has no other members14.


How to Delete/Remove Users in Linux (userdel Command) | Linuxize

userdel(8) --- Linux manual page

updatedb(8) --- Linux manual page

Understanding the /etc/login.defs File | Linuxize

Contribute your Thoughts:

0/2000 characters
Laila
3 days ago
Wait, does it really delete all files? Sounds risky!
upvoted 0 times
...
Lelia
8 days ago
Totally agree, that's how it works.
upvoted 0 times
...
Michal
14 days ago
A) and B) are correct!
upvoted 0 times
...
Benedict
19 days ago
I vaguely recall a practice question mentioning that if a user is the last in a group, that group gets deleted, so maybe option E is also correct?
upvoted 0 times
...
Vincenza
24 days ago
I feel like option D might be misleading; I don't think all files are removed from all filesystems, just the home directory, right?
upvoted 0 times
...
Lemuel
29 days ago
I'm not sure about option B, but I remember something about home directories being removed with the --remove flag.
upvoted 0 times
...
Kara
1 month ago
I think option A is definitely correct since userdel is meant to remove users from the system.
upvoted 0 times
...

Save Cancel