Linux for Developers
/Beginner
Groups
Definition
A command that prints the names of all the groups the current user (or a specified user) is a member of.
Explain Like I'm New
Checking which teams you are on. If you can't access the 'finance' folder, you run this command to see if you are actually in the 'finance' team.
Real World Example
You try to run a Docker command but get Permission Denied. You type `groups` and notice 'docker' is not in the list. You realize you forgot to add yourself to the Docker group.
Common Use Cases
- •Troubleshooting access issues
- •Verifying usermod commands
Interview Questions
basic
- If you type `groups` by itself with no arguments, whose groups does it show?
intermediate
- After you add yourself to a new group using `usermod`, you type `groups` and the new group isn't there. Why?