• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

groupmod: command not found

by admin

The groupmod command is used to change the group’s own attributes. It will edit the /etc/group file for you. Modifications of the group might include changing its name or GID. Adding a user to a group is considered to be a modification of the user, not the group. As such, it is accomplished using the usermod command.

Some groupmod options include the following.

Option Description
-g Change the group ID.
-n Rename a group.

Syntax

The syntax of the groupmod command is:

# groupmod [options] {group names}

To modify the name of a group after it has been created, use the groupmod command. To make the change, log in as the root user and enter the following command:

# groupmod -n newgroup currentgroup

where newgroup is the new name you want to give the group, and currentgroup is the current name of the group. For example, to change a group name from admin to geek, you would use the following command:

# groupmod -n geek admin

If you encounter below error while running the groupmod command:

groupmod: command not found

you may try installing the passwd package as shown below as per your choice of distribution.

Distribution Command
Debian apt-get install passwd
Ubuntu apt-get install passwd
Alpine apk add shadow
Arch Linux pacman -S shadow
Kali Linux apt-get install passwd
Fedora dnf install shadow-utils-2
Raspbian apt-get install passwd

groupmod Command Examples

1. Change the group ID:

# groupmod -g 123 group_name

2. Rename a group:

# groupmod -n new_group_name group_name

See the man page groupmod for a full list of all the command-line options available.

Filed Under: Linux

Some more articles you might also be interested in …

  1. handbrakecli Command Examples
  2. jtbl Command Examples
  3. btrbk: command not found
  4. gcal: Displays calendar
  5. tar Command Examples in Linux
  6. pvs: command not found
  7. “git add” Command Examples
  8. ltrace Command Examples in Linux
  9. fprintd-delete Command Examples in Linux
  10. “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright