An ad-free and cookie-free website.
Learn to find your user id at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux whoami Command Summary with Examples (3:39)
Our thirteenth word, or command to memorize is
whoami from the category Users.
whoami allows you to display the
current user's name. Recall from our last video, we created the alias
lsd, and that led us to kick off this, our first discussion on users.
And with that as an opener...
||Print help screen|
||Show version information|
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s).
whoami command has
and no arguments, so it's one of the simplest commands we'll cover.
We'll touch on the self-explanatory double-dash options shortly
So why is
whoami an important command?
Well, for those with multiple identities, like system administrators,
whoami provides a quick command
offering an opportunity for self-reflection.
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, type
And look, the computer knows me by my name paul. Isn't that nice? Well, actually, Linux translates every user into a numeric userid called a UID, which we'll explore later.
And this offers an introduction to an advanced command to be discussed
And at this point, I'd like to draw your attention to a common option,
used across many commands, the double-dash
Pretty easy huh? As you can tell, I wanted to approach the topic of users slowly, because often the subject is best left to the experts.
Okay now you know how to use
And you know the syntax for commands, options and arguments.
One last tip about the
whoami is the second of the
who, what, where, when, why, how questions offering
perspective that we cover here. Can you guess what command comes next?
Okay, thanks for visiting today. I hope this was a fun introduction
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If you like to learn, connect at YouTube, Twitter and at our no-spam email list.
aliascommand, hit Back.
whereiscommand, click Next.
A newly-updated free resource. Connect and refer a friend today.