When to use groups
Use groups to inspect group membership while diagnosing access to shared directories or service resources. Membership shown for an account and the groups active in an existing login session are not always identical.
Syntax
groups [USER…]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
Show your groups
groupsThe active process's supplementary groups are displayed.
Check user groups
groups deployThe named account's configured group membership is looked up.
Get numeric IDs
id -G deployNumeric group IDs provide an alternative when group names are ambiguous or unavailable.
Notes and limitations
- New groups after changing an account usually appear in a new session.
- The name service data and the actual groups of the already running process may differ.
Common questions and troubleshooting
Why does a newly added group not work yet?
Existing sessions can retain their old group set. Start a new authenticated session and verify its active groups.
Does group membership alone grant file access?
No. File and parent-directory permissions, ACLs and security policy still determine whether a particular operation is permitted.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man groups.