English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux groupadd command

Linux Command Manual

The groupadd command is used to create a new workgroup, and the information of the new workgroup will be added to the system file.

Related Files:

  • /etc/group Group Account Information.
  • /etc/gshadow Secure Group Account Information.
  • /etc/login.defs Shadow Password Suite Configuration.

Syntax

The syntax format of the groupadd command is as follows:

groupadd [-g gid [-o]] [-r] [-f] group

Parameter Description:

  • -g: Specify the id of the new workgroup;
  • -r: Create a system workgroup, the group ID of the system workgroup is less than 500;
  • -K: Overwrite the configuration file "/etc/login.defs";
  • -o: Allows the addition of workgroups with non-unique group IDs.
  • -f,--force: If the specified group already exists, this option will be ignored and the program will exit with a successful status. When used with -g and the specified GID_MIN already exists, choose another unique GID (i.e., -g is closed).

Online Examples

Create a new group and add a group ID.

#groupadd -g 344 w3codebox

At this time, a project with a group ID (GID) of 344 is generated in the /etc/group file.

Linux Command Manual