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