Linux groupdel

您所在的位置:网站首页 linux如何查看组群信息内容记录 Linux groupdel

Linux groupdel

2024-07-10 05:42| 来源: 网络整理| 查看: 265

用途说明

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 ~]#



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3