Rename or retag a Linux group and adjust its numeric ID quickly from the shell. 19.03.2026 | reading time: 3 min Need to rename a group or change its numeric ID without manually editing system files? The `groupmod` command is the safe, supported tool for that job; it updates the local group databases so permissions and scripts that rely on group names keep working. Rename a group in place Create a small test scenario and watch the change happen: ```bash sudo groupadd -g 1001 devs getent group devs sudo groupmod -n engineers devs getent group engineers ``` Expected verification output after creation and rename: ```text devs:x:1001: engineers:x:1001: ``` This shows the name changed while the GID stayed the same. Change a group's GID safely To change the numeric ID and keep ownership consistent, change the GID then update file and user ownerships: ```bash sudo groupmod -g 1100 engineers getent group engineers sudo find / -group 1001 -exec chgrp -h engineers {} + ``` After `groupmod` the `getent` line might read `engineers:x:1100:` and the `find` command updates files still owned by the old GID to the new group name. Practical cautions and tips Always back up the group files first with `sudo cp /etc/group /etc/group.bak` and `sudo cp /etc/gshadow /etc/gshadow.bak`; `groupmod` will fail if the target name or GID already exists; if users have the group as primary, consider `usermod -g` for each user or coordinate with file ownership updates; for networked user stores like NIS or LDAP use the directory tooling rather than `groupmod` locally. When `groupmod` is not enough For distributed accounts, central directories, or when you must change many file ownerships, combine `groupmod` with tools like `find` and `chgrp` or use LDAP management utilities; remember that `groupmod` only edits local files such as `/etc/group` and `/etc/gshadow`. Next steps and study advice Try renaming and re-GIDing a noncritical group in a VM, then verify with `getent group` and by listing file ownerships; mastering these basics helps in systems administration tasks and is a practical step toward certifications like CompTIA Linux+ or LPIC-1—consider intensive exam preparation at bitsandbytes.academy to accelerate progress. Join Bits & Bytes Academy First class LINUX exam preparation. utilities security scripting