groupadd
Create a new group
Overview
Creates a new group account using the values specified on the command line plus the default values from the system.
Syntax
groupadd [OPTION]... GROUP_NAMECommon Options
-g GID, --gid GIDUse GID for the new group. The GID must be a non-negative integer. This value must be unique, unless the -o option is used.
-o, --non-uniqueAllow creation of a group with a non-unique (duplicate) GID (used with -g).
-r, --systemCreate a system group. System groups are usually those needed by system services and often have GIDs in a specific low range.
-f, --forceExit successfully if the specified group already exists. If used with -g and the specified GID already exists, the command will fail (unless -o is also used).
-p PASSWORD, --password PASSWORDUse this encrypted password for the new group. Note: This option is generally not recommended as group passwords are rarely used on modern Linux systems.
Examples
Creates a new group named developers.
Creates a group projectalpha with a specific GID 1005.
Creates a system group named webadmins.
If existing_group_name already exists, the command will exit successfully without an error.