Show user groups on Linux
On most standard Linux operating systems you can view the current users’
group membership with:
id -nGor if you’re currently logged in as root then you can just tag the user
that you want to view on the end of the command. For example, if I’m logged in
as root and want to see the groups that john is a member of:
id -nG johnwhich will then output:
root@mimas:~# id -nG john
john docker