I'm trying to find my current logged in group without wanting to use newgrp to switch.
Asked
Active
Viewed 7.8k times
2 Answers
114
I figured I can use the following.
id -g
To get all the groups I belong
id -G
And to get the actual names, instead of the ids, just pass the flag -n.
id -Gn
This last command will yield the same result as executing
groups
-
8
-
11Add *-n* to see group names instead of GIDs: *id -gn* and *id -Gn* respectively. – misko321 Jul 15 '16 at 11:13