Linux groups Command

n this tutorial we learn how to use groups command in Linux. groups command print the groups a user is in. This command is similar to id command for groups.

What is groups Command in Linux?

In this tutorial we learn how to use groups command in Linux. groups command print the groups a user is in. This command is similar to id command for groups.

groups Syntax

groups [OPTION]... [USERNAME]...

Get The Groups of Current User

To get the list of groups where the current user is in we can run groups command without options.

groups

Get The Groups of Specific User

To get the groups of a specific user, we can pass the username to groups command

groups username

groups Command Manual / Help

We can use man and info command to see the manual page of groups command.

groups command also have

--help option to show list of options.

To open man page for groups command we can use command below. To exit man or info page you can press q.

man groups

To open info page for groups command we can use command below.

info groups

To open help page from groups command we can run command below.

groups --help

Linux groups Command Source Code

You can find groups command source code from the folowing repositories:

You can read tutorials of related Linux commands below:

Summary

In this tutorial we learn how to use groups in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.