What is true regarding the command userdel –force –remove bob? (Choose TWO correct answers.)
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.
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.
Answer: A, B
Explanation:
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.
Reference: 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
Latest 102-500 Dumps Valid Version with 194 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund