linux系统中groupadd、groupdel命令

1、linux中groupadd命令用于创建新的用户组

  直接测试,创建用户组:

[root@linuxprobe home]# tail -n 3 /etc/group  ## 查看用户组信息后三行
tcpdump:x:72:
linuxprobe:x:1000:
apache:x:48:
[root@linuxprobe home]# groupadd grouptest01  ##创建 grouptest01
[root@linuxprobe home]# tail -n 3 /etc/group
linuxprobe:x:1000:
apache:x:48:
grouptest01:x:1001:
[root@linuxprobe home]# groupadd -g 7777 grouptest02 ## -g参数指定组ID
[root@linuxprobe home]# tail -n 3 /etc/group
apache:x:48:
grouptest01:x:1001:
grouptest02:x:7777:

2、groupdel命令删除用户组

[root@linuxprobe home]# tail -n 3 /etc/group
apache:x:48:
grouptest01:x:1001:
grouptest02:x:7777:
[root@linuxprobe home]# groupdel grouptest02  ## 删除用户组grouptest02
[root@linuxprobe home]# tail -n 3 /etc/group
linuxprobe:x:1000:
apache:x:48:
grouptest01:x:1001:
[root@linuxprobe home]# groupdel grouptest01  ##删除用户组grouptest01
[root@linuxprobe home]# tail -n 3 /etc/group
tcpdump:x:72:
linuxprobe:x:1000:
apache:x:48:
原文地址:https://www.cnblogs.com/liujiaxin2018/p/13843175.html