Groupdel Command
Groupdel Command
• About groupdel
• groupdel syntax
• groupdel examples
• Related commands
• Linux and Unix commands help
About groupdel
Used by a superuser or root to remove a group.
Conditions
You may not remove the primary group of any existing user; you must remove the user before you
remove that user's primary group.
You should manually check all file systems to ensure that no files remain owned by this group.
groupdel will not automatically check for files owned by the deleted group.
groupdel syntax
groupdel group
Configuration
The following configuration variable, located in /etc/login.defs, changes the behavior of groupdel:
MAX_MEMBERS_PER_GROUP (number)
Maximum members per group entry. When the maximum is reached, a new group entry (line) is started
in /etc/group (with the same name, same password, and same GID).
The default value is 0, meaning that there are no limits in the number of members in a group.
This "split group" feature is primarily used to limit the length of lines in the group file. This is useful to
make sure that lines for NIS (Network Information Service) groups are not larger than 1024 characters.
If you need to enforce such limit, you can use 25.
Note: split groups may not be supported by other tools and programs. You should not use this variable
unless you really need it.
Exit Values
The groupdel command exits with the following values:
0 success.
groupdel examples
Tip: For this command to work you must have superuser rights or be logged in as root.
groupdel newgroup
In this example, the groupdel command would delete the group newgroup.