Most Unix and Linus distributions provide a command called "groups".
With no parameters, it simply returns the name of the groups assigned to the current user. Optionally you can specify a user name as the first and only parameter to the groups command, which will show all groups assigned to that user.
For example, the following displays all groups assigned to you
anyuser adm sudo lpadmin
The following displays all groups assigned to the sys user: