groupadd, groupdel, groupmod -- add, delete, or change a group account


/etc/groupadd [-g gid [-o]] [-x "extendedOptionString"] [-X optionsFile] group_name

/etc/groupdel group_name

/etc/groupmod [-g gid [-n group_name] [-o]] [-x "extendedOptionString"]
[-X optionsFile] group_name

/etc/groupmod -D [-x "extendedOptionString"] [-X optionsFile]


With no options specified, groupadd creates the specified group account on the local system.

Groups can be created in one of three locations:

If a group already exists locally when an NIS version of that group is created, the local group is removed from the system. If an NIS version of a group already exists when a local version is created, the remote group is not deleted. If you wish to delete the remote group, you must do so before adding the local group of the same name.

groupdel deletes a group account from the Group Account database.

groupmod modifies one or more of the attributes associated with the specified group account.

group_names have these limitations:


The following options are supported by groupadd and groupmod:

-g gid
Specify the group ID (new or revised). It must be a non-negative integer less than 60000. The minimum and maximum values are defined in /etc/default/accounts.

Allow the use of a GID already assigned to another account. This option is only valid when the Low or Traditional security profile is configured (specifically, REUSEUID=TRUE must be present in /etc/default/login).
The following options are supported by groupmod only:

-n group_name
Rename the specified group to group_name.

Modify the specified system default attribute.
The following options are supported by groupadd, groupdel, and groupmod:

-x "extendedOptionString"
Specify extended account attributes. See ``Extended options and option files''.

-X optionsFile
Specify the file from which the group attributes are to be taken.

Extended options and option files

Extended options use the following syntax:

{ attribute value }

Attributes associated with a set of values should enclose the values in nested braces:

{ attribute { value value } }

When used on the command line, the outermost braces ({ }) must be enclosed in double-quotes (") to prevent interpretation by the shell. Values containing spaces should be further enclosed in single quotes (').

Option files use the same syntax (minus the double-quotes).

There are two groups of attributes: individual (ones that can be set only for individuals, such as group name) and system defaults (such as largest possible GID). System default attributes require the use of the -D option.

The following attribute is defined for both individuals and system defaults (and so is valid with or without the -D option):

If defined, the group is distributed via NIS (NIS must be configured for accounts to be distributed).

The following individual attributes are defined (not valid with -D option):

The numeric group identifier.

The list of accounts who are a members of a group.

The unique name that identifies a group.
These attributes are system defaults (valid with -D):

The largest numeric identifier assigned to a new group (must be less than 60000).

The largest numeric identifier assigned to a new group by default (must be less than or equal to maxGid).

The smallest numeric identifier assigned to a new group (must be greater than or equal to 0).

The smallest numeric identifier assigned to a new group by default (must be greater than or equal to 0 and greater than or equal to minGid).

The next available pw_uid in the range of minGid to maxGid.

Exit values

Upon completion, these utilities exit with one of the following values:

The action was successful.

An error occurred.


group file

local group file for NIS servers

distributed group file for NIS servers

Subsystem Authorizations database

user/group account creation defaults

See also

groupls(ADM), userls(ADM), useradd(ADM)

Standards conformance

groupadd is conformant with AT&T SVID Issue 2.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003