Linux and Unix userdel command
Quick links
About userdel
Syntax
Examples
Related commands
Linux and Unix main page
Enables a super user to remove a users account.
userdel [-r] login
| -r | Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually. |
EXIT VALUES
0 - success
1 - can't update password file
2 - bad command syntax
6 - specified user doesn't exist
8 - user currently logged in
10 - can't update group file
12 - can't remove home directory
For these commands to work you must have super user rights or be logged in as root.
In the
below example the userdel command would remove the newperson account and also the newpersons home directory directory, in this case (/home/newperson).
userdel -r newperson
