What is the userdel Command?
To remove a user from your system, type this command, and the user will be deleted after execution.
Syntax:
userdel [options] username
Options:
-
-r → This option deletes the user and also removes their home directory along with all files inside it.
Example:userdel -r username
-
-f → This option forcefully deletes the user, even if they are logged in or have running processes.
Example:userdel -f username
-
-Z → If SELinux is enabled, this option deletes any SELinux user mapping connected to that user.
Example:userdel -Z username
Example: Delete a user
Command:
userdel prabha
Output:
No message appears in the terminal.












