addgroup [options] groupname Linux Commands – Overview with Examples and FAQs

Introduction

The Linux command addgroup is used to add a new group to the system. This command is used to create a new group with a specified group name and group ID. It can also be used to modify existing groups. The addgroup command has several options that can be used to customize the group’s settings, such as setting the group’s password, setting the group’s default user, and setting the group’s access permissions. This command is useful for system administrators who need to manage user access to resources on the system.

Examples

The addgroup command is used to add a new group to the system.

Syntax:
addgroup [options] groupname

Options:
-h, –help: Display help message and exit
-g, –gid GID: Set the group ID of the new group to GID
-K, –key KEY=VALUE: Override /etc/login.defs defaults
-o, –non-unique: Allow to create groups with duplicate (non-unique) GID
-R, –root CHROOT_DIR: Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory
-S, –system: Create a system account

Example:
To add a new group called “developers” with GID 1000, the command would be:

addgroup -g 1000 developers
[ad_1]

[ad_2]

The addgroup command in Linux is used to add a new group to the system. It is a command line utility that is used to create and manage user groups. The addgroup command has several options that can be used to customize the group creation process.

The addgroup command can be used with the following options:

  • -g : This option is used to specify the group ID (GID) of the new group.
  • -f : This option is used to force the creation of the group, even if the group already exists.
  • -h : This option is used to specify the home directory of the new group.
  • -K : This option is used to specify the group’s key value pairs.
  • -o : This option is used to specify that the group should be created as a non-unique group.
  • -p : This option is used to specify the group’s password.
  • -r : This option is used to specify that the group should be created as a system group.

To create a new group using the addgroup command, use the following syntax:

addgroup [options] groupname

For example, to create a new group called mygroup with the GID of 1000, use the following command:

addgroup -g 1000 mygroup

The addgroup command can be used to create and manage user groups in Linux. It has several options that can be used to customize the group creation process.

Jaspreet Singh Ghuman

Jaspreet Singh Ghuman

Jassweb.com/

Passionate Professional Blogger, Freelancer, WordPress Enthusiast, Digital Marketer, Web Developer, Server Operator, Networking Expert. Empowering online presence with diverse skills.

jassweb logo

Jassweb always keeps its services up-to-date with the latest trends in the market, providing its customers all over the world with high-end and easily extensible internet, intranet, and extranet products.

GSTIN is 03EGRPS4248R1ZD.

Contact
Jassweb, Rai Chak, Punjab, India. 143518
Item added to cart.
0 items - 0.00