Ubuntu Linux: Find Groups A User Belongs To

by on January 25, 2012 · 0 comments· LAST UPDATED January 25, 2014

in , , ,

How do I find out in which groups Ubuntu Linux users belong to? How do I find out Ubuntu Linux group membership for a particular user named tom?

You can use any one of the following command to list a groups a user belongs to:
Tutorial details
DifficultyEasy (rss)
Root privilegesNo
RequirementsNone
Estimated completion time1m

a) id command - Display real and effective user and group IDs.

b) groups command - Display the groups a user is in on Ubuntu Linux.

Ubuntu: See which groups your Linux user belongs to

Open the Terminal app or login to the remote server over the ssh based session. Type the following id command
$ id -Gn

To display the groups a user named 'tom' is in on Ubuntu Linux, enter:
$ id -Gn tom

You can also use deprecated groups command as follows:
$ groups
$ groups tom

Sample outputs:

Fig. 01: groups and id command on Ubuntu

Fig. 01: groups and id command on Ubuntu

See also
TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 0 comments… add one now }

Leave a Comment

Tagged as:

Previous Faq:

Next Faq: