groupdel
Delete a group from the system
TLDR
Delete an existing group
SYNOPSIS
groupdel group_name
PARAMETERS
group_name
The name of the group to be deleted.
DESCRIPTION
The groupdel command is a utility used to remove a group from the system's group database. This database typically resides in the /etc/group file. When a group is deleted, all members of that group will no longer have the associated group privileges.
groupdel removes a group by its group name. It does not remove any files or directories owned by that group; those must be manually located and their group ownership changed. It's crucial to ensure no files or processes are actively using the group before deleting it, as this could lead to access issues. The command typically requires root privileges or equivalent administrative access to modify the system's group database.
CAVEATS
groupdel will fail if the specified group is the primary group for any user. Change the primary group for all users of the deleting group first, using usermod for instance. groupdel does not remove files or directories owned by the group. You must manually change the ownership of these files.
EXIT STATUS
The groupdel command exits with a status of 0 upon successful completion. A non-zero exit status indicates an error. Common error conditions include: 1. The specified group does not exist. 2. The group is the primary group for an user. 3. Insufficient permissions.
HISTORY
groupdel is a standard Unix utility, existing since the early days of Unix-like systems. Its purpose has remained consistent: to provide a simple and direct way to remove groups from the system's group database. The command has undergone updates and refinements over time, particularly in handling edge cases and improving security.