Today’s article, as was indicated in the title, is a short article where we learn how to show the groups you belong to. It’s just a simple command, so we’ll toss in some extra knowledge. But, this is just a short article. You won’t have much to do in this article.
The latest article explained groups and can be read by clicking this link:
The last article explained how to list all the available groups in Linux. This one will explain all the groups your user account belongs to. If you want to know the groups you belong to, it’s simple enough.
If you didn’t read the article, Linux is a multi-user operating system. There are also groups. A user can belong to multiple groups and have permissions matching those groups. The example I gave in the previous article was the sudoers group. You (probably) belong to that group, giving you access to the sudo command. That is how you have elevated permissions for your account, which is quite different than using the root account.
Even if you don’t know this, you’re almost certainly a member of multiple groups. In the previous article, we learned how to show those groups and today we’ll learn how to show the groups you belong to.
Show The Groups You Belong To:
If you want to show the groups you belong to, you’ll need to have an open terminal. Just press
With your terminal open, you can show the groups you belong to with this command:
1 | groups |
Your output will be different but here’s an example:
1 2 | $ groups kgiii adm cdrom sudo dip plugdev lpadmin sambashare vboxusers |
This also works with other users. Here’s the syntax:
1 | groups <user_name> |
That will show the groups that the user belongs to. It’s a pretty simple thing to learn and a pretty handy thing to learn. It’s so simple and easy that this is an intentionally short article.
Closure:
There you have it… It’s a short article but showing the groups you belong to isn’t a complicated affair. This is something anyone can do and there’s no reason to make the article longer than it already is. While I could make it longer, it’d be wasting my time and your time. It’s just that easy.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.