Rename user's group name

I just did usermod -l login-name old-name to change the username, but the group name is still the old one.

Any way of renaming the group name? I can't find any info to do so.

2 Answers

groupmod should work fine:

$ groupmod --help
Usage: groupmod [options] GROUP
Options: -g, --gid GID change the group ID to GID -h, --help display this help message and exit -n, --new-name NEW_GROUP change the name to NEW_GROUP -o, --non-unique allow to use a duplicate (non-unique) GID -p, --password PASSWORD change the password to this (encrypted) PASSWORD

Use it like this:

groupmod --new-name NEW_GROUP_NAME OLD_GROUP_NAME
3

To reNAME as you asked:
sudo groupmod -n new-name current-name

Note: If the name is already in use but you want to use it anyway:
sudo groupmod -o -n new-name current-name

If you are root you don't need to use sudo

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like