Linux and Unix groupadd command

Quick links

About groupadd
Syntax
Examples
Related commands
Linux and Unix main page

About groupadd

Creates a new group account.

Syntax

groupadd [-g gid [-o]] group

-g gidThe numerical value of the group's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than 99 and greater than every other group. Values between 0 and 99 are typically reserved for system accounts.

Examples

Tip For this command to work you must have super user rights or be logged in as root.

groupadd newgroup

The above example would create a new group called "newgroup". This new group could then have users added to it using the useradd command.

Related commands

groupdel
groupmod
useradd