groups
Permissions
Usage
groups [user]Lists the groups a user belongs to; a group just added with usermod does not appear until the next login, because the list is fixed when the session starts.
Common flags
| Flag | Meaning |
|---|---|
| none | groups takes no options; id -nG prints the same list |
Examples
groupsEvery group you belong to.
groups www-dataThe groups of another user.
Numeric and symbolic modes name the same thing: 755 and u=rwx,go=rx are the same permission.
How to read this
- Square brackets [ ] mark a part you may leave out.
- An ellipsis … means you can list more than one.
- Flags are case-sensitive — in some commands -r and -R do different things.
Questions
Q. What does groups do?
Lists the groups a user belongs to; a group just added with usermod does not appear until the next login, because the list is fixed when the session starts.
Q. How do I type it?
groups [user] — square brackets mark the parts you can leave out.
Q. How many flags are worth knowing?
1 are listed here; the full set is in man groups. This command sits under Permissions.
Related commands
man page: man groups