Linux groupmod Command
The Linux groupmod command is used to change a group's ID or name.
When you need to change a group's ID or name, you can use the groupmod command.
Syntax
groupmod [-g <群组识别码> <-o>][-n <新群组名称>][群组名称]
Parameters:
- -g
Set the group ID to use. - -o Allow reuse of a group ID.
- -n
Set the new group name to use.
Example
Change a group name
[root@runoob.com ~]# groupadd linuxso
[root@runoob.com ~]# tail -1 /etc/group
linuxso:x:500:
[root@runoob.com ~]# tail -1 /etc/group
linuxso:x:500:
[root@runoob.com ~]# groupmod -n linux linuxso
[root@runoob.com ~]# tail -1 /etc/group
linux:x:500:
Linux Command Reference