• 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 Examples in Linux

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.

Below are associated configuration files:

  • /etc/group: Group account information.
  • /etc/gshadow: Secure group account info.

Syntax

The syntax of the groupmod command is:

# groupmod [options] {group names}

Some groupmod options include the below.

Option Used To Example
-g Change a group ID. # groupmod -g 123 sales
-n Rename group # groupmod -n newsales sales

groupmod Command Examples

1. To change the group ID:

# groupmod -g 600 SUPPORT
# groupmod --gid 600 SUPPORT

2. To change the group name:

# groupmod -n SUPPORT
# groupmod --new-name SUPPORT

3. To change the group ID with non-unique:

# groupmod -o 0 SUPPORT
# groupmod --non-unique 0 SUPPORT

4. To change the group password:

# groupmod -p $!31231@23$531&465%361&23*2314251 SUPPORT
# groupmod --password $!31231@23$531&465%361&23*2314251 SUPPORT

5. To get the help for groupmod:

# groupmod -h
# groupmod --help

Filed Under: Linux

Some more articles you might also be interested in …

  1. “git shortlog” Command Examples
  2. enum4linux: command not found
  3. dbus-daemon Command Examples in Linux
  4. luac Command Examples
  5. httpry Command Examples
  6. “docker exec” Command Examples
  7. mate-screenshot Command Examples in Linux
  8. smbclient Command Examples in Linux
  9. “az login” Command Examples (Log in to Azure)
  10. “go tool” Command Examples

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