Linux groupdel --删除群组

用途说明

groupdel命令用来删除群组,该命令会把/etc/group和/etc/gshadow中相关的数据删除。群组名须存在(Thenamed group must exist)。必须手动确认一下所有的文件系统,确保没有文件或目录没有使用此群组(You must manually check all file systems to insurethat no files remain with the named group as the file group ID)。如果有任何一个用户账号属于该群组的话就不能移除该群组(You may not remove the primary group of anyexisting user)。 最好先移除使用者后再移除群组(You must remove the user before you remove thegroup)。注意:Linux上的中文手册实在不咋的,没法理解,如下所示。

man groupdel 写道

描述

groupdel命令会修改系统帐号档,会删除所有已经存在的group. 群组名须存在。

 

你须手动确认一下所有的档案系统确保有没有档案还是没修正群组名变成群组ID。

 

警告

如果有任何一个群组的使用者在线上的话就不能移除该群组。最好先移除使用者后再移除群组。

 

 

常用参数

格式:groupdel {GROUP}

删除群组。

 

格式:groupadd {GROUP}

添加群组。

 

格式:useradd {USER}

添加用户,同时会自动创建同名群组。

 

格式:userdel {USER}

删除用户,同时会自动删除同名群组。

 

使用示例

示例一

[root@jfht ~]# useradd hello

 

[root@jfht ~]#

[root@jfht ~]# groupdel hello

groupdel:不能删除用户的主组。

[root@jfht ~]#

[root@jfht ~]# userdel hello

[root@jfht ~]# groupdel hello

groupdel:hello 组不存在

[root@jfht ~]#


  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值