General

Short: Show The Groups You Belong To

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:

List All The Groups In Linux

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 CTRL + ALT + T and your default terminal should open. Otherwise, open a terminal from your application menu.

With your terminal open, you can show the groups you belong to with this command:

groups

Your output will be different but here’s an example:

$ groups
kgiii adm cdrom sudo dip plugdev lpadmin sambashare vboxusers

This also works with other users. Here’s the syntax:

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.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Enable/Disable Your Network Interface

Today we'll cover one way to enable or disable your network interface in the Linux…

5 months ago

Check Your NIC Speed In The Terminal

Today's exercise is a nice and simple exercise where we check your NIC speed in…

5 months ago

Easily Monitor Your Wireless Connection

Have you ever wanted to easily monitor your wireless connection? Well, now you can learn…

6 months ago

Count The Files In A Directory

I think I've covered this before with the ls command but this time we'll count…

6 months ago

Get System Information With The ‘uname’ Command In Linux

Today we'll be learning about a basic Linux command that's known as 'uname' and it…

6 months ago

hardinfo Has Been Rebooted As hardinfo2

If you've used hardinfo in the past, it may interest you to know that hardinfo…

6 months ago