In Unix/Linux, how do you find out what group a given user is in via command line?
相关问题
- Is shmid returned by shmget() unique across proces
- how to get running process information in java?
- Error building gcc 4.8.3 from source: libstdc++.so
- Why should we check WIFEXITED after wait in order
- Null-terminated string, opening file for reading
On Linux/OS X/Unix to display the groups to which you (or the optionally specified user) belong, use:
which is equivalent to
groups [user]
utility which has been obsoleted on Unix.On OS X/Unix, the command
id -p [user]
is suggested for normal interactive.Explanation on the parameters:
or just study /etc/groups (ok this does probably not work if it uses pam with ldap)
or
This one shows the user's uid as well as all the groups (with their gids) they belong to