Linux命令(114)之groupdel

linux命令之groupdel

1.groupdel介绍

linux命令groupdel是用来删除群组。如果待删除的群组中仍包含用户,需先删除这些用户后,才能删除群组,当然使用-f参数也可以强制删除。

groupdel命令删除用户组时,会修改/etc/group和/etc/gshadow文件。

2.groupdel用法

groupdel [参数] GroupName

groupdel参数
参数说明
-h显示帮助信息
-f强制删除用户组,即使有用户存在

3.实例

3.1.显示groupdel的帮助信息

命令:

groupdel -h

[root@rhel77 ~]# groupdel -h
Usage: groupdel [options] GROUP

Options:
  -h, --help                    display this help message and exit
  -R, --root CHROOT_DIR         directory to chroot into
  -P, --prefix PREFIX_DIR       prefix directory where are located the /etc/* files
  -f, --force                   delete group even if it is the primary group of a user

[root@rhel77 ~]# 

3.2.删除cc用户组

命令:

groupdel cc

[root@rhel77 ~]# cat /etc/group
root:x:0:
......
cc:x:1129:
[root@rhel77 ~]# groupdel cc

3.3.强制删除apps用户组

命令:

groupdel -f apps

[root@rhel77 ~]# cat /etc/group | grep apps
apps:x:1123:tomcat
[root@rhel77 ~]# groupdel apps
  • 10
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小黑要上天

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值