|HP-UX Reference > G
HP-UX 11i Version 3: February 2007
groupmod — modify a group on the system
groupmod [-S alternate_password_file] [-g gid [-o]] [-n name] [[-a|-m|-d ]-l userlist] group
The groupmod command modifies a group on the system by altering the appropriate entry in the /etc/group file.
The groupmod command must be used with the group argument, which is the name of the group to be modified. The name consists of a string of printable characters that may not include a colon (:) or newline (\n).
The groupmod command uses the following options:
The groupmod command is aware of NIS user entries. Only local groups may be modified with groupmod. Attempts to modify an NIS group will result in an error. NIS groups must be administered from the NIS server. If groupmod is used on a system where NIS is installed, it may fail with the error
group x does not exist
(return value 6) if the group specified is an NIS group (see group(4)). However, NIS groups are checked when verifying uniqueness of the new gid or new group name, which may result in the above error, or the error
GID # is not unique
(return value 4).
The groupmod command exits with one of the following values:
Change the group ID of the group project2 to 111 in the file /etc/group if the group project2 exists. This is done even if the group ID 111 is already in use.
groupmod -g 111 -o project2
Change the name of project2 to project22 in the file /etc/group if the group project22 does not already exist.
groupmod -n project22 project2
Because many users try to write to the /etc/passwd file simultaneously, a password locking mechanism was devised. If this locking fails after subsequent retrying, groupmod terminates.