Low Orbit Flux Logo 2 F

Linux How To View / List Groups

Listing or viewing groups in Linux is easy. To start you can just check the group file like this. It will show you every group and who belongs to it.


cat /etc/group

Show all groups for current user:


groups
id -nG 

Show all groups for specified user:


groups user2
id -nG  user2

Show all users in a group:


getent group webusers

Show all groups like this ( almost the same as just viewing the /etc/group file ):


getent group