Permissions, users and access

Command groups

Show user groups

Linux · Bash examples · commands run on the selected server

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

No arguments
Show groups of the current process.
USER
Query the groups of the specified account.

Usage examples

Show your groups

groups

The active process's supplementary groups are displayed.

Check user groups

groups deploy

The named account's configured group membership is looked up.

Get numeric IDs

id -G deploy

Numeric 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.