Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
480 views
in Technique[技术] by (71.8m points)

linux - 是否有命令列出所有Unix组名? [关闭](Is there a command to list all Unix group names? [closed])

I know there is the /etc/group file that lists all users groups.

(我知道有/etc/group文件列出了所有用户组。)

I would like to know if there is a simple command to list all user group names in spite of parsing the world readable /etc/group file.

(我想知道是否有一个简单的命令列出所有用户组名称,尽管解析了世界可读的/etc/group文件。)

I am willing to create an administrator web page that lists Linux accounts' group names.

(我愿意创建一个列出Linux帐户组名的管理员网页。)

  ask by cavila translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To list all local groups which have users assigned to them, use this command:

(要列出已为其分配用户的所有本地组,请使用以下命令:)

cut -d: -f1 /etc/group | sort

For more info- > Unix groups , Cut command , sort command

(有关更多信息 - > Unix组剪切命令排序命令)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...