最近需要获取group 对应的id 数字号码,突然想不起来怎么获得了,现在在这里进行备忘一下:
$ cut -d: -f3 < <(getent group sudo)
27
getent group sudo
cat /etc/group | grep -i sudo
$ echo "Group sudo with GID="$(cut -d: -f3 < <(getent group sudo))""
Group sudo with GID=27
保持更新,更多内容请关注 cnblogs.com/xuyaowen;
我之前也写过一个用户管理相关的博客,请访问下面的链接:
https://cloud.tencent.com/developer/article/1766817 linux 添加用户并设置主目录,shell 并赋予权限; is not in the sudoers file. This incident will be reported.
参考链接:
https://askubuntu.com/questions/639990/what-is-the-group-id-of-this-group-name
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有