The Linux groups command shows which user groups an account belongs to.
If you have ever been added to a team at work, a group chat, or a multiplayer squad, you already understand the basic idea. Linux groups collect users together so the system can give several accounts the same access or permissions.
Start with groups
groups
Run the command with no extra options to see the groups associated with your current account.
$ groups
burton sudo developers
This example says the current user belongs to three groups: burton, sudo, and developers. Your own output will be different.
Video 1: The groups command
Why groups exist
Imagine five people share a computer project. Instead of configuring the same access separately for all five accounts, Linux can place them in one group and assign access to that group.
- A user is an individual account.
- A group is a collection of user accounts.
- Group membership can help determine what files, folders, devices, or administrative actions a user may access.
The previous lesson, Linux Command #34 – id, shows user and group IDs. groups is narrower: it gives you a quick list of group names.
Check another user
groups alex
If the account exists and you are allowed to query it, this asks Linux to display the groups associated with alex.
Video 2: Creating and working with Linux groups
A familiar permissions example
Suppose a family computer has a folder that only members of a photos group may edit. If your username appears as a member of photos, Linux can use that membership when deciding whether you have group-level access.
At work, the same idea might be used for a shared project folder. On a Linux server, a group might collect the accounts that are allowed to perform a particular task. The exact permissions are configured elsewhere; groups simply helps you see membership.
Simple data-center example
You log into a Linux management computer and a tool says you do not have permission to use a shared file. Running groups is a quick first check: are you actually a member of the team group that should have access?
Video 3: Managing users and groups from the command line
groups vs. id
groups: quickly lists group names.id: shows more identity information, including numeric user and group IDs.
Use groups when the simple question is: Which groups does this user belong to?
Practice
- Open a Linux terminal.
- Run
groups. - Count how many group names appear.
- Run
idand find the group information there. - In one sentence, explain why putting several users into one group can make permissions easier to manage.
Key takeaway
groups answers one straightforward Linux question: Which groups does this user belong to? It is a fast identity and permissions troubleshooting command and a natural companion to whoami and id.

Leave a comment