userdel
Delete a user account and related files
Overview
Deletes a user account and related files. It modifies the system account files, deleting all entries that refer to the LOGIN.
Syntax
userdel [OPTION]... LOGINCommon Options
-f, --forceForces the removal of the user account, even if the user is still logged in. It also forces removal of the home directory and mail spool if -r is used, even if shared or not owned by the user.
-r, --removeFiles in the user's home directory will be removed along with the home directory itself and the user's mail spool.
-Z, --selinux-userRemove any SELinux user mapping for the user's login.
Examples
Deletes the user account unwanteduser, but their home directory and mail spool remain.
Deletes the user oldemployee and also removes their home directory and mail spool.
Forcibly removes problematicuser, even if they are logged in. If used with -r, it will forcibly remove home/mail data.