groupadd command

LINUX-Frequently used commands

groupadd command Add a group
Syntax
groupadd  [Option] [Group name]
The groupadd command is used to add a new group.
Usually, when you add a new user, a group is also created with the same name as the user name..
Group information is stored in the /etc/group file.
When executing the command, specify the name of the group to be added as an argument.
Frequently used options
-g  [group ID]      Create a group by specifying a group ID
Example: Adding a group
$ su – ← Become root with su command
Password: ←Enter root password
# groupadd centos ← Create “centos” group
# grep centos /etc/group ← Check the group
centos:x:511: ← Group ID is “511” and “centos” group is created..
Example: Create a new group by specifying the group ID
$ su – ← Become root with su command
Password: ←Enter root password
# groupadd -g 800 centos ← Create the ‘centos’ group with a group ID of ‘800’.
# grep centos /etc/group ← Check the group
centos:x:800: ← Group ID is “800” and “centos” group is created
タイトルとURLをコピーしました