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