groupmod
modify a group definition
TLDR
SYNOPSIS
groupmod [options] group
DESCRIPTION
groupmod modifies the attributes of an existing group on the system. It can change the group name, group ID (GID), or group password.When changing GID, files owned by the group are NOT automatically updated. You must manually find and update file ownership using commands like find / -gid OLDGID -exec chgrp NEWGROUP {} \;.Changing a group name has no effect on file ownership since files reference groups by GID, not name.
PARAMETERS
-g, --gid GID
Change group ID to GID-n, --new-name NAME
Change group name to NAME-o, --non-unique
Allow non-unique GID-p, --password PASSWORD
Set encrypted group password-a, --append
With -U, append the given users to the group's existing members instead of replacing the list-U, --users USER[,USER,...]
Comma-separated list of usernames to set as the group's members-R, --root CHROOTDIR_
Apply changes in chroot environment-P, --prefix PREFIXDIR_
Apply changes in prefix directory (uses config files there without chrooting)-h, --help
Display help message and exit
INSTALL
CAVEATS
Changing GID does not update file ownership automatically. Users must log out and back in for group changes to take effect. Cannot change a group to a name or GID that already exists (unless -o is used for GID).
HISTORY
groupmod is part of the shadow-utils package, which has been the standard for Unix group management across Linux distributions. It provides safe modification of the /etc/group and /etc/gshadow files.
