← 返回命令列表

Linux command

group 命令

文本

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

常用示例

View group file

cat /etc/group

Find groups for user

groups [username]

Find group by name

getent group [groupname]

List group members

getent group [groupname] | cut -d: -f4

说明

/etc/group is the system file that defines groups and their members. Each line contains a group entry with four colon-separated fields: group name, password placeholder, numeric GID, and a comma-separated list of member usernames. Groups control file access permissions and are fundamental to Unix security. Users can belong to multiple groups, with one primary group set in /etc/passwd.

FAQ

What is the group command used for?

/etc/group is the system file that defines groups and their members. Each line contains a group entry with four colon-separated fields: group name, password placeholder, numeric GID, and a comma-separated list of member usernames. Groups control file access permissions and are fundamental to Unix security. Users can belong to multiple groups, with one primary group set in /etc/passwd.

How do I run a basic group example?

Run `cat /etc/group` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more group examples?

This page includes 4 examples for group, plus related commands for nearby Linux tasks.