如何快速查看 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 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM