groupdel
Linux · Users and permissions · reference only
What it does
Deletes a group from the system. By default it refuses to delete a group that is some user's primary group.
Syntax
groupdel [opciones] grupo
Options and parameters
grupoName of the group to delete.
-fForces removal even if it is some user's primary group.
-R DIRApplies the changes inside the given root directory (chroot).
-hShows help and exits.
Usage examples
sudo groupdel devsDeletes the devs group.
getent group devsIf the group was deleted, it prints nothing.
sudo groupdel -f antiguosForces the removal of a group that is still some user's primary group.
Notes and common mistakes
- To delete a primary group, first change the user's group with usermod -g or delete the user.
- Files that belonged to the group keep an orphan GID.