Search

How to create a new group in Linux using groupadd command

The groupadd command can be used in Linux to add user groups to the system. The basic syntax of Linux groupadd command is groupadd <groupname>. If no command-line options are used, the group is created with the next available Group ID number (GID) above 499. To specify a GID, use the groupadd -g <gid> <group-name> command.

[[email protected] ~]# groupadd engineering

To add existing Linux users to a group, use the usermod -aG <groups> <username> command.

[[email protected] ~]# usermod -aG engineering tintin

Note: You should be familiar how to add a user in Linux before learning this lesson. Click the following link to learn how to add a user in a Linux machine using useradd command.

Related Tutorials
• Introduction to Linux user administration
• How to add a user in Linux using useradd command
• How to use passwd command to manage user passwords
• How to modify a Linux user using usermod command
• How to set Linux password aging using chage command
• How to remove user from Linux using userdel command
• The Linux user database (/etc/passwd)
• The Linux password database (/etc/shadow)
• Introduction to Linux User Group
• Linux Group Database (/etc/group) file
• How to manage Linux user group