Show all users and their groups/vice versa

All users:

$ getent passwd

All groups:

$ getent group

All groups with a specific user:

$ getent group | grep username

Leave a Comment