How to list all users in a Linux group?

user323094 picture user323094 · May 14, 2010 · Viewed 360.3k times · Source

How do I list all members of a group in Linux (and possibly other unices)?

Answer

Josh H picture Josh H · Nov 18, 2011
getent group <groupname>;

It is portable across both Linux and Solaris, and it works with local group/password files, NIS, and LDAP configurations.