An ad-free and cookie-free website.
Learn to find user and group information at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux id Command Summary with Examples (3:32)
Our seventy-seventh word, or command to memorize is
id from our category
id allows you to show user and group
||Print help screen|
||Show all group IDs|
||Show user ID|
Recall from the previous video (tutorial) on
chown, we set file ownership to user
and groups. We also saw a text file that stores group information
Now we'll get a quick view of our current memberships.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s).
id command has
10 options, and an argument optionally is the
Like most commands, help is available with double-dash
-G option shows Group IDs (GID) and
-u shows User IDs (UID), so yes, all
groups and users are given an identification number.
So why is
id an important command?
Well, it may help to see which groups you're in so you can identify
what responsibilities come with your membership.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's start by with an
id -G for paul.
And there's the group number, but let's make it more descriptive with an
-n at the end.
And that looks better. Again, this could be a long list if for example I had multiple different groups and they had long names.
Then on the user side,
id -u for the
User ID (UID).
-n for name.
And last, the default behavior, of simply
id shows all the info in one place,
which may get messy if you're part of a lot of groups.
Okay now you know how to use
And you know the syntax for commands, options and arguments.
One last tip about the
command. So we saw who we are with the
whoami command in video (tutorial) 13
and now with
id we can find our
User ID (UID) and group membership (GID). Here are two others we won't
afford a whole video to, first is the
who command which shows you who is
logged in currently and second is
which shows you what they're doing. Interesting.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If I've helped you in some way today. Please consider giving back in some way.
chowncommand, hit Back.
sucommand, click Next.
A newly-updated free resource. Connect and refer a friend today.