≡ Menu

who command

Linux / Unix: who Command Examples To List Users on The Systems

who command

I am a new Linux and Unix system user. How do I display who is logged on my Linux or Unix-like operating system using shell prompt?
[click to continue…]

Linux / Unix: Find Out What tty I’m Using

What is a tty under Linux / UNIX? How do I find out what tty I'm on?
[click to continue…]

Linux / UNIX: See If Particular Users Are Logged Into Server

How do I see if my friends or coworkers are logged into the same Linux or BSD or UNIX (AIX, HP-UX, Apple OS X) server / workstation as I am from a command line?
[click to continue…]

UNIX / Linux List Current Logged In Users

How do I print the user names of users currently logged in to the current UNIX / Linux host / server from a command prompt?
[click to continue…]

Linux Logout user / Logoff User Commands

I am a new Linux sysadmin. I am using Linux on HP server. How do I logout users from my systems? How can I forcefully logoff any user using bash shell on Linux?
[click to continue…]

How can I find out who is logged on my UNIX / Linux system?

Q. How do I display who is on the UNIX / Linux system?

A. On a Linux (on Solaris/FreeBSD or any other UNIX) system, many users will be sharing the same server.

Users will use telnet (outdated and insecure) or ssh (secure and highly recommended) to login remotely.

So if you want to find out your friend or a coworker is logged in or not, use the following commands.

If you want to find out who's logged in on the Linux server including what time they logged in and from which network computer then you can use who command:

who command ~ show who is logged on

who commands works with almost all Linux and UNIX like oses. It show who is logged on to your system. It displays information about currently logged in users. By default, this includes the login name, tty name, date and time of login and remote hostname if not local.
$ who

raj     ttypV    Jan 17 07:23   .     (
ben     ttypW    Jan 17 07:42   .     (
miku    ttypX    Jan 17 07:28   .     (user-del-net-202.vsnl.net.in)
root    ttypY    Jan 17 04:11   .     (
roomy   ttyq0    Jan 17 07:32   .     (org-rev-1.bsnl.net.in)
anita   ttyq2    Jan 17 07:33   .     (
gads    ttyq3    Jan 17 07:40   .     (gtw-1.nixcraft.in)
bencs   ttyq5    Jan 17 07:44   .     (dsl5.bsnl.co.in)
pol20um ttyq6    Jan 17 07:47   .     (gtw-2.nixcraft.co.in)

Sometime you just want to find out if user raj logged in or not then you can use grep command:

$ who | grep raj

Try out following command if you have more than 20+ users logged in (so that you can see one page of logged in users at a time):

$ who | less
$ who | more