当前位置: 移动技术网 > 科技>操作系统>Linux > 如何快速查看 group 对应的id

如何快速查看 group 对应的id

2019年10月14日  | 移动技术网科技  | 我要评论

最近需要获取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;

我之前也写过一个用户管理相关的博客,请访问下面的链接:

 linux 添加用户并设置主目录,shell 并赋予权限; is not in the sudoers file.  this incident will be reported.

参考链接:

 

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网