LinuxCommandLibrary

groups

TLDR

Show current user groups

$ groups
copy
Show groups for user
$ groups [username]
copy
Show groups for multiple users
$ groups [user1] [user2]
copy

SYNOPSIS

groups [options] [users]

DESCRIPTION

groups displays the groups a user belongs to. Without arguments, it shows groups for the current user.
The command reads from /etc/group and the user's supplementary group list. It shows both primary and secondary group memberships.
groups shows user group membership.

PARAMETERS

USERS

Usernames to check groups for.
--help
Display help information.
--version
Display version.

CAVEATS

Shows cached groups at login. New group memberships require re-login. Primary group shown first.

HISTORY

groups is a standard Unix command, part of GNU coreutils on Linux systems.

SEE ALSO

id(1), groupmems(8), newgrp(1)

Copied to clipboard