Skip to content

Remove a user and group in linux (Centos / Ubuntu)

Learn how to remove a user in linux. Learn how to remove a group in linux.

Removing a user in linux

To remove a user, we use userdel command.

Syntax

sudo userdel <user-name>

Example

sudo userdel clouduser

You can also delete that user’s home directory and mail spool by using the -r flag with userdel command.

sudo -r userdel clouduser

Removing a group in linux

To delete a group, groupdel command is used.

Syntax

sudo groupdel <group-name>

Example

sudo groupdel cloudgroup

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.