← 返回命令列表

Linux command

groups 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show current user groups

groups

Show groups for user

groups [username]

Show groups for multiple users

groups [user1] [user2]

说明

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.

参数

--help
Display help information.
--version
Display version.

FAQ

What is the groups command used for?

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.

How do I run a basic groups example?

Run `groups` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --help do in groups?

Display help information.