How To Use addgroup or groupadd Command In Linux

addgroup or groupadd command in Linux are very similar, however using addgroup command seems to be more interactive than groupadd. With the help of these commands, a Linux platform administrator can create or add a new group. Also, this command allows to modify configuration of group which is to be created. So, in this article, we will discuss about how to use addgroup command in Linux.

Installing addgroup command in Linux platforms

As we have mentioned in the adduser command guide previously, the addgroup command can be used only after a utility called addgroup is installed on system. Various Linux platform users can follow the mentioned commands below, depending on their OS.

Debian/Ubuntu users

sudo apt-get install addgroup

Centos/RedHat users

sudo yum install addgroup

Fedora users

sudo dnf install addgroup

How to use addgroup command in Linux with examples?

Example 1: Adding a new group

sudo addgroup servonode

Example 2: Adding new group with new id

sudo addgroup servonode --gid 2136

Example 3: Adding a new group with new shell

sudo addgroup servonode --shell /bin/sh

Example 4: Using help option with addgroup command

sudo addgroup –help

Example 5: Using addgroup command to view its versions

addgroup --version