groups—prints group membership of user

groups [ user... ]

The command groups prints on standard output the groups to which you or the optionally specified user belong.

Get UNIX® Shells by Example, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.