Linux Classes
Share This With a Friend  
LINUX CLASSES - LINUX COMMANDS

Who is Logged In?

If you want to know which users are currently logged in to your Linux system, which console they're using, and the date and time they logged in, issue the who command. You'll see output something like this:

who
root tty1 Nov 2 17:57
hermie tty3 Nov 2 18:43
sigmund tty2 Nov 2 18:08

In the output shown here, the term tty stands for teletype. In the olden days of computing, a terminal was just a keyboard with an attached printer, so you read everything off the teletype.

If you've logged in with multiple virtual consoles and changed your identity on any of them, you may have some trouble figuring out who you are--or at least what user is logged in to the console you're using. If you find yourself in such an identity crisis, try this related command:

whoami

The whoami command will tell you the name of the current user. Just as a side note, you can also use the who am i command (a variant of the who command) to return the name of the current user. But it doesn't always work s you might expect. If you're logged in as root, and use the su command to switch to another user, who am i will return "root" as the current user. For this reason, I recommend that you train yourself to always use the whoami command when you want to know the current user name.

For more information on the who command, see the who manual.

Previous Lesson: Switching Users
Next Lesson: Date and Time

[ RETURN TO INDEX ]


   

Comments - most recent first
(Please feel free to answer questions posted by others!)

No comments yet

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:
 
 


Ask Bob Rankin - Free Tech Support


Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.