Home > Linux > How to view the groups a user is a member of in Linux

How to view the groups a user is a member of in Linux

October 15th, 2009 Leave a comment Go to comments

Introduction

In a previous Linux article I wrote about how to add a user to a group in Linux and in this short article I will show you how to view which groups a Linux user is a member of.

View the groups a Linux user is a member of

To view the groups that a Linux user is a member of, the command you need to use is the groups command.  An example of this is below, the example would show use which groups the user1 user is a member off

groups user1

The above command will produce an output along the lines of the following.

user1 : group1 group2

And that’s really all there is to it, In the next article I will show you how to remove a user from a group in Linux.

If you have found this post helpful please consider making a donation to keep the site running.

Categories: Linux
  1. No comments yet.
  1. No trackbacks yet.