Users
The groupmod command
Modifies an existing group, for example renaming it.
Syntax
sudo groupmod [-n NUEVO] grupoMost useful options
-n NUEVOChanges the group name-g GIDChanges the idCopy-ready examples
$ sudo groupadd viejo && sudo groupmod -n nuevo viejo && getent group nuevoRename a groupYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Renaming does not change the permissions of files that already used it by name.
FAQ
Can I change only the GID?
Yes, with groupmod -g, but check the files that belonged to that group.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course