一天一条Linux指令-groupdel

来源:互联网 发布:穷怎么打扮知乎 编辑:程序博客网 时间:2024/05/18 23:12

用途说明

groupdel命令用来删除群组,该命令会把/etc/group和/etc/gshadow中相关的数据删除。群组名须存在(The named group must exist)。必须手动确认一下所有的文件系统,确保没有文件或目录没有使用此群组(You must manually check all file systems to insure that no files remain with the named group as the file group ID)。如果有任何一个用户账号属于该群组的话就不能移除该群组(You may not remove the primary group of any existing user)。 最好先移除使用者后再移除群组(You must remove the user before you remove the group)。注意: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 ~]#

0 0
原创粉丝点击