The userdel command has several options that can be useful for managing user accounts. Here are some common options:
-
-r: Remove the user's home directory and mail spool along with the user account. -
-f: Force the removal of the user account, even if the user is logged in or has running processes. -
-Z: Remove any SELinux user mapping for the user being deleted. -
--help: Display help information about theuserdelcommand and its options. -
--version: Show the version information of theuserdelcommand.
Example Usage:
- To forcefully delete a user named "alice" and remove her home directory:
sudo userdel -rf alice
Always refer to the manual page (man userdel) for more detailed information on these options and their usage.
