In linux distros you can delete user or delete user home directory also using this command we will described detailed with examples
Syntax
# userdel [-r] username
-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
Eg:
# userdel username # userdel –r username