Search

How to remove user from Linux using userdel command

The command used for removing a user from a Linux machine is userdel and the simple syntax for userdel command is userdel <username>. If no command line options are used, the user is deleted and can no longer log into the system. The private user group for the user is also deleted, and the user is removed from any other groups of which he was a member.

The user’s home directory and any other files the user owned are not deleted from the system by default.

To remove the user’s home directory and mail spool, use the userdel -r <username> command. All other files owned by the user must be deleted manually if the administrator needs them removed.

Example:

[root@localhost ~]# userdel tintin

Related Tutorials
• Introduction to Linux user administration
• How to add a user in Linux using useradd command
• How to use passwd command to manage user passwords
• How to modify a Linux user using usermod command
• How to set Linux password aging using chage command
• The Linux user database (/etc/passwd)
• The Linux password database (/etc/shadow)
• Introduction to Linux User Group
• How to create a new group in Linux using groupadd command
• Linux Group Database (/etc/group) file
• How to manage Linux user group