Linux Classes
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!)

Flowey the Flower (20 Nov 2015, 09:17)
Howdy!
I'm Flowey the Flower!
May I ask a simple question?
Is the kill command capable of killing???
Hossein Ayazi (15 Dec 2011, 02:02)
how i found List's users?
Majed (08 Aug 2011, 08:41)
thanks for the tips about who am i command because it happened to me. i logged in to another user and it printed an output as if i issued only "who"
Grace Kimani (23 Feb 2011, 00:38)
Absolutely informative !
pradeep (06 Sep 2010, 16:42)
Its simply superb!!. It would be great if I get a mail/notification whenever this pages gets updated. Thanks in advance.
jnlickey (02 Jun 2010, 09:44)
Download or send in for a free CD for Ubuntu 9.10 or 10.0 and dual boot it with MS Windows. Also you can download Linux Mint or Fedora 12 or 13 and there is a neat little application (Fedora LiveUSB Creator) that you can download to install it on a USB drive as well. Once you download the iso file just burn it to a CD/DVD or use the application to install it to a USB thumb drive. Then boot up your computer with the USB or CD/DVD and then start using and learning linux. Thats what I am doing.
Also this is a great tutorial - thank you Bob for making it for all of us newbie's!
Rsingh36 (02 Jun 2010, 07:37)
This site is simply great......also,pls let me know if there is any website where we can have hands on practice for Linux commands and simple shell scipting...


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:




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

Popular Linux Topics

Linux Intro
Linux Files
Linux Commands
Change Password
Copy Files
Linux Shell Basics

Linux Tutorial

Who is Doctor Bob?
What is Linux?
History of Unix
Operating Systems
What's Next?

Linux Basics

Living in a Shell
Root and Other Users
Virtual Consoles
Logoff and Shutdown
Choosing a Shell
The Command Prompt
Wildcards
Command History
Aliases
Redirection
Pipelines
Processes
Stopping a Program
Environment Variables
Help!

Linux Files

The Linux File System
Linux File Names
Linux Directories
Directory Terminology
Navigating the File System
Listing Linux Files
Displaying Linux Files
Copying and Renaming Files
Creating Files and Directories
Deleting Files and Directories
Linux Files - Wildcards
The Nine Deadly Keystrokes
Linux File Permissions
Changing File Permissions

Linux Commands

Important Linux Commands
Changing Your Password
Switching Users
Who is Logged In?
Date and Time
The Echo Command
Spell Checking
Printing Linux Files
Joining Files
Searching for Files
Comparing Files
Task Scheduling
Linking Files

Linux Editors

The Vi Editor
The Emacs Editor
The Pico Editor

Linux Data Manipulation

Slicing & Dicing
Heads or Tails?
Sorting Data
Eliminating Duplicates
Selecting Columns
Selecting Records
Search & Replace
Crunching Data
Finding Files
Pipe Fitting

Linux Shell Programming

Linux Shell Scripts
Executing a Script
Shell Script Variables
Shell Script Logic
Shell Script Looping
Shell Script Debugging

Perl Programming

Perl Basics
Perl Variables
Perl Arguments
Perl Logic
Perl Looping
Perl and Files
Perl Pattern Matching

Linux and Email

Sending Email
Reading Email
Other Mail Commands
Using Pine for Email
The Pine Inbox
Pine Email Basics
Pine Email Folders
Pine for Power Users

Compression and Encoding

Linux File Compression
Archiving With Tar
Compression With Gzip
Compress and Zcat
Zmore and Zless
Zip and Unzip
Encoding and Decoding
Encryption

Linux Does DOS

Accesing DOS Files
Accesing DOS Partitions
Running DOS Programs

Managing Linux

Updating Your Linux System
Installing Packages with RPM
Uninstalling Packages w/ RPM
Upgrading Packages with RPM
Querying Packages with RPM

AltStyle によって変換されたページ (->オリジナル) /