Quickly reveal which groups a user belongs to using the simple "groups" command. 07.12.2025 | reading time: 2 min Want to know which groups a user belongs to right now? Use the `groups` command to list group names for the current user or a specified user and get an immediate view of access scopes. Quick Demo A short session shows how it looks in practice: ```bash $ groups alice sudo docker $ groups bob bob $ groups alice alice : alice sudo docker ``` Primary Group Matters Primary and supplementary groups are different: `id -gn` shows the primary group name, `id -G` shows GIDs; use `id` to cross-check numerical IDs and names when membership or permissions behave unexpectedly. Practical Tips If a user was just added to a group, he must re-login or run `newgrp` to get the new supplementary group in the session; for scripts prefer `getent group` to resolve group membership reliably on LDAP/SSSD systems. Other Commands Nearby `groups` is quick, but administrators also reach for `id` to see UIDs and GIDs, `getent` to query NSS databases, and `gpasswd` or `usermod` for changing memberships when needed. A Short Outlook Knowing which groups a user belongs to is a tiny step with big operational impact; dig deeper into user and group management to avoid permission surprises, and consider formal study to sharpen your skills. Join Bits & Bytes Academy First class LINUX exam preparation. utilities security scripting troubleshooting