Groupmod command

What is the Groupmod Command?

The groupmod command is used to modify an existing group on a Linux system. You can change a group’s name or GID (group ID) using this command.

How Does It Work?

When you run the groupmod command, you can specify a new name or GID for an existing group.

Syntax: groupmod [options] groupname

Common Options

Here are some commonly used options with the groupmod command:

Examples of Using the Groupmod Command

Here are some practical examples of how to use the groupmod command:

To rename the group "admins" to "superadmins": $ groupmod -n superadmins admins
To change the GID of the "developers" group to 1001: $ groupmod -g 1001 developers

Visual Example

Below is a visual example of using the groupmod command:

Groupmod Command Example