LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

groups

display user group memberships

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 group memberships for a user. Without arguments, it shows groups for the current user. The primary group is listed first, followed by supplementary groups.The command reads from /etc/group and the user's supplementary group list. It is equivalent to id -Gn but with simpler output formatting.

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
Kai