Forrest logo
back to the groups tool

groups:tldr:9b915

groups: Print group memberships for a list of users.
$ groups ${username1 username2 ---}
try on your machine

The command "groups" is used to display the group memberships of a user or multiple users in Linux or Unix operating systems.

The specific command "groups ${username1 username2 ---}" is a variation of the "groups" command, where you can replace "${username1 username2 ---}" with the usernames of one or more users, separated by a space. This allows you to view the group memberships for multiple users at once.

For example, if you want to check the group memberships for users "user1" and "user2", you can use the command: groups user1 user2

The output will display the groups these users belong to, providing a list of group names. Each group name is separated by spaces, and it is usually preceded by the username it belongs to.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the groups tool