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

Linux groupadd command

Linux Command大全

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 to be created;
  • -r: Create a system workgroup, the group ID of the system workgroup is less than 500;
  • -K: Override the configuration file "/ect/"login.defs";
  • -o: Allows adding a group ID number that is not unique for a workgroup.
  • -f,--force: If the specified group already exists, this option will be disabled and the program will exit with a successful status when used with -When g is used together and the specified GID_MIN already exists, choose another unique GID (i.e.,-g closed).

Online Examples

Create a new group and add a group ID.

#groupadd -g 344 w3codebox

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

Linux Command大全