groups command on linux can be used to know which all groups a user belongs to
Just type in groups on the terminal. Below is the output on my Mac machine
staff everyone localaccounts _appserverusr admin
Note: Check out our system design tutorial series System Design Questions