I'm trying to find my current logged in group without wanting to use newgrp to switch.
Asked
Active
Viewed 8.8k times
90
2 Answers
122
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
-
9
-
12Add -n to see group names instead of GIDs: id -gn and id -Gn respectively. – misko321 Jul 15 '16 at 11:13
groups
! – cylgalad Jan 03 '16 at 09:42