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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Common Error Messages from Command xfs_repair in Linux
  2. img2txt Command Examples in Linux
  3. How to Stop SSH Session From Getting Timed Out
  4. /var/cache/yum Constantly Filling Files System in CentOS/RHEL
  5. “error: Bind to port 2222 on 0.0.0.0 failed: Permission denied” – error while starting sshd service on CentOS/RHEL
  6. lsblk Command Examples in Linux
  7. Beginners guide to Apache HTTP Server – Installation and Configuration
  8. mimetype: command not found
  9. How to Enable Remote Desktop to Share the Current Desktop Session in CentOS/RHEL 7
  10. How to configure apache virtual host on ubuntu

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright