addgroup command in Linux with Examples

addgroup command in Linux is used to add a new group to your current Linux machine. This command allows you to modify the configurations of the group which is to be created. It is similar to the groupadd command in Linux. The addgroup command is much interactive as compared to groupadd command.

Installing addgroup command

To install addgroup tool use the following commands as per your Linux distribution.

In case of Debian/Ubuntu

$sudo apt-get install addgroup

In case of CentOS/RedHat

$sudo yum install addgroup

In case of Fedora OS



$sudo dnf install addgroup

Working with addgroup command in Linux

1. To add a new group

sudo addgroup groupname

To-add-a-new-group.png

This command will create a new group for your Linux machine.

2. To add a new group with specified group id

sudo addgroup groupname --gid 12345

To-add-a-new-group-with-specified-group-id

This command will add a new group with the specified group id.

3. To create a group with a specific shell

sudo addgroup groupname --shell /bin/sh

To-create-a-group-with-a-specific-shell



This command will allocate the /bin/sh shell to the newly create group.

4. To enter verbose mode

sudo addgroup groupname --debug

To-enter-verbose-mode

This command will execute the command in the verbose mode that means it will print all details of the tasks it is executing.

5. To display help related to addgroup command.

addgroup --help

To-display-help-related-to-addgroup-command

This command will display the help section of the addgroup command.

6. To display version

addgroup --version

6-To-display-version

This command will display the version details of the addgroup command.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.