groupmod
Modify a group definition on the system
Overview
The groupmod command modifies the definition of the specified group. It changes group attributes like GID, name, or password.
Syntax
groupmod [OPTION]... GROUP_NAMECommon Options
-g GID, --gid GIDChange the group ID to GID. The GID must be a non-negative integer. This value must be unique, unless the -o option is used.
-o, --non-uniqueAllow the group GID to be non-unique (used with -g).
-n NEW_GROUP_NAME, --new-name NEW_GROUP_NAMEChange the group name to NEW_GROUP_NAME.
-p PASSWORD, --password PASSWORDChange the group's encrypted password to PASSWORD. Note: This option is generally not recommended as group passwords are rarely used on modern Linux systems.
Examples
$ sudo groupmod -n new_developers old_developers
Renames the group old_developers to new_developers.
$ sudo groupmod -g 1010 editors
Changes the GID of the editors group to 1010.
$ sudo groupmod -g 1011 -o devteam
Changes the GID of devteam to 1011, even if GID 1011 is already in use.
Related Commands
groupaccountmodifychangepermissionsgroupmod