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

What is true regarding the command userdel --force --remove bob? (Choose TWO correct answers.)
A) The user bob is removed from the system's user database. and B) The user bob's home directory is removed.
C) The locate database is updated to drop files owned by bob.
D) All files owned by bob are remove from all mounted filesystems.
E) In case bob was the last member of a group, that group is deleted.

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
Caprice
23 days ago
Wait, does it really delete all files? Sounds risky!
upvoted 0 times
...
Rosalia
28 days ago
Totally agree, A and B make sense!
upvoted 0 times
...
Elbert
1 month ago
A and B are correct.
upvoted 0 times
...
Mable
1 month ago
C) is definitely not true, right?
upvoted 0 times
...
Reta
1 month ago
I thought the group deletion was a myth.
upvoted 0 times
...
Laila
2 months ago
Wait, does it really delete all files? Sounds risky!
upvoted 0 times
...
Lelia
2 months ago
Totally agree, that's how it works.
upvoted 0 times
...
Michal
2 months ago
A) and B) are correct!
upvoted 0 times
...
Benedict
2 months 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
2 months 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
2 months 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
3 months ago
I think option A is definitely correct since userdel is meant to remove users from the system.
upvoted 0 times
...

Save Cancel