To find the groups that a user belongs to in Ubuntu Linux, you can use the groups
command.
Here’s how to find the groups that a user belongs to:
- Open a terminal window or log in to a virtual console.
- Type the following command to list the groups that the specified user belongs to:
groups <username>
Replace
<username>
with the name of the user that you want to find the groups for.
For example:
groups john
john : john sudo
In this example, the user john
belongs to the john
and sudo
groups.
Note: The output may vary depending on the Linux distribution and the specific user configuration.