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:
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:
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.
Comments - most recent first
(Please feel free to answer questions posted by others!)
Also this is a great tutorial - thank you Bob for making it for all of us newbie's!
NO SPAM! If you post garbage, it will be deleted, and you will be banned.
Copyright © by -
All rights reserved - Redistribution is allowed only with permission.