Linux/Unix Command: grouppadd


groupadd – Create a new group


groupadd [-g gid [-o]] [-r] [-fgroup


The groupadd command creates a new group account using the values specified on the command line and the default values from the system. The new group will be entered into the system files as needed. The options which apply to the groupaddcommand are

-g gid
The 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 500 and greater than every other group. Values between 0 and 499 are typically reserved for system accounts.
This flag instructs groupadd to add a system account. The first available gid lower than 499 will be automatically selected unless the -g option is also given on the command line.
This is an option added by Red Hat.
This is the force flag. This will cause groupadd to exit with an error when the group about to be added already exists on the system. If that is the case, the group won’t be altered (or added again).
This option also modifies the way -g option works. When you request a gid that it is not unique and you don’t specify the -o option too, the group creation will fall back to the standard behavior (adding a group as if neither -g or -o options were specified).
This is an option added by Red Hat.

3 groupadd Examples

1. Create a new Linux group

The following example creates a new group called apache

$ groupadd apache

Make sure it is created successfully.

# grep apache /etc/group
There is a list for all groups in the File: /etc/group

About zephyr9000

Happy sailer
This entry was posted in Linux Command and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s