Groups Command

Displaying groups for a user

The groups command is used to display the groups a user belongs to.

The syntax of the groups command is: groups user. If a user is not specified, then the groups are displayed for the account that issued the command. Any user can issue the groups command.


john@mint01a:~$ groups
john adm cdrom sudo dip plugdev lpadmin sambashare libvirt

john@mint01a:~$ groups john
john : john adm cdrom sudo dip plugdev lpadmin sambashare libvirt

john@mint01a:~$ groups testuser
testuser : testuser group1 group2