Command: Groupadd
Syntax: groupadd [-G GID] groupname
[Email protected] ~]# groupadd grptest1[[email protected] ~]# tail-n1/etc/groupgrptest1:x:502:
The "-g" option does not create groups according to the system default GID, which is the same as the user, with GID starting from 500.
[Email protected] ~]# groupadd-g 511 grptest2[[email protected] ~]# tail-n2/etc/groupgrptest1:x:502:grptest2:x:511:
The "-G" option allows you to customize the GID.
Delete a group
Command: Groupdel
[Email protected] ~]# Groupdel grptest2[[email protected] ~]# tail-n3/etc/grouptestgroup:x:500:user1:x:501:grptest1: x:502:
There are no special options for this command, but there is one case where you cannot delete a group:
[Email protected] ~]# Groupdel User1groupdel:cannot Remove the primary group of user ' User1 '
This is because the User1 account is included in the User1 group and can only be deleted if the User1 account is deleted.
This article is from "Linux rookie" blog, please be sure to keep this source http://490617581.blog.51cto.com/11186315/1757785
Linux Groupadd-groupdel (add a group and delete a user group)