groupmod命令用于修改已有用户组的GID(使用-g参数)或用户组名称(使用-n参数):
groupmod用法:用法:groupmod [选项] 组
1、groupmod -g GID 组名,修改用户组的GID,-g取GID之意
[root@hadoop ~]# cat /etc/group | grep dafugroup #用户组dafugroup1修改之前GID为1104
dafugroup1:x:1104:
[root@hadoop ~]# groupmod -g 1105 dafugroup1
[root@hadoop ~]# cat /etc/group | grep dafugroup #用户组dafugroup1修改之前GID为1105
dafugroup1:x:1105:
2、groupmod -n new_group 组名,修改用户组的名称,-n取new name之意
[root@hadoop ~]# cat /etc/group | grep dafugroup
dafugroup1:x:1105:
[root@hadoop ~]# groupmod -n dafugroup1_new dafugroup1
[root@hadoop ~]# cat /etc/group | grep dafugroup
dafugroup1_new:x:1105: