0% found this document useful (0 votes)
41 views2 pages

Groupdel Command

The groupdel command removes Linux/Unix groups and has the following syntax: groupdel group. It will not remove a group if it is a primary group for any existing users. The groupdel command checks the configuration variable MAX_MEMBERS_PER_GROUP in /etc/login.defs to determine if it should split large groups over multiple lines. It exits with status codes 0 for success or non-zero codes for errors like invalid syntax, non-existent group, unable to remove primary group, or failure to update group file.

Uploaded by

Darko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views2 pages

Groupdel Command

The groupdel command removes Linux/Unix groups and has the following syntax: groupdel group. It will not remove a group if it is a primary group for any existing users. The groupdel command checks the configuration variable MAX_MEMBERS_PER_GROUP in /etc/login.defs to determine if it should split large groups over multiple lines. It exits with status codes 0 for success or non-zero codes for errors like invalid syntax, non-existent group, unable to remove primary group, or failure to update group file.

Uploaded by

Darko
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Linux groupdel command

Updated: 04/26/2017 by Computer Hope

• 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.

2 invalid command syntax!

6 specified group doesn't exist.

8 can't remove user's primary group.

10 can't update group file.

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.

You might also like