1. 程式人生 > >linux查看用戶組所有成員

linux查看用戶組所有成員

$1 gid user gre 用戶 int bsp /etc/ 所有

1、grep ‘user1‘ /etc/group //找出用戶組的gid

user1:x:1004://得出gid=1004

2、 awk -F":" ‘{print $1"\t"$4}‘ /etc/passwd |grep ‘1004‘ //列出user1組的所有成員

user1 1004

linux查看用戶組所有成員