Users
The groups command
Shows which groups a user belongs to. With no arguments, the current user.
Syntax
groups [usuario]Copy-ready examples
$ groupsYour groups$ groups rootroot's groupsYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- The first group listed is usually the user's primary group.
FAQ
How does it differ from id?
groups only lists the groups; id also shows the UID and GID.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course