Deleting a Group
Command : groupdel groupname
Important Rules
- Deleting a group makes its files orphaned (owned by GID only).
- Primary groups cannot be deleted.
- Only supplemental groups can be removed.
How to Delete a Primary Group
- First change users’ primary group.
- Then delete the group.
Remember : Always check group usage before deletion to avoid orphaned files.

Key Notes
- A group cannot be deleted if it is a primary group of any user.
- Use
usermod -gto change the primary group. - Use
usermod -aGto add supplementary groups. - Use
gpasswd -dto remove users from supplementary groups.
✔️ This sequence ensures the delete operation works correctly and safely.