Use of userdel in user and group management on the command line interface
Userdel-delete a user account and related files
In Linux, The userdel command is used to delete users and related files in the system.
Syntax
Userdel [Option] username
Parameters
-R -- remove: when a user is deleted, the user's home directory is also deleted. By default, the user's home directory is not deleted.
-F -- force: forcibly delete users, home directories, and mailboxes
-H: Get help information
-Z -- selinux-user:
Remove SELinux user assigned to the user's login from SELinux
Login mapping.
This option does not know what it is, but does not know how to use it. Please let me explain it. Thank you.
Note: When a user account is deleted, user files in non-user main directories are not deleted. The administrator must search and delete these files using the find command.
The find command will be described in detail later
Example:
# Userdel manager delete a manager User
# Find/-user manager-exec rm {} \ find and delete the file created by the manager user