如何快速查看 group 对应的id

最近需要获取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://www.cnblogs.com/xuyaowen/p/linux-adduser.html 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 

猜你喜欢

转载自www.cnblogs.com/xuyaowen/p/get-group-id.html