The Linux who command

The Linux "who" command lets you display the users that are currently logged into your Unix computer system.

The basic who command with no command-line arguments shows the names of users that are currently logged in, and depending on which Unix/Linux system you are using, may also show the terminal they're logged in on, and the time they logged in.


Since I'm the only one logged into my Linux system right now, I see output like this:

alvin pts/0     2011-03-02 21:23 (ip-address-shown-here)

On a very busy Unix/Linux system the output of the who command may scroll off your terminal screen. To solve that, pipe the output of the who command into the Linux more command, like this:

who | more

The -a argument of the who command lists all available output for each user on your system.

who -a

The Linux 'w' command

These days the Linux 'w' command actually provides much more interesting user information, and you may want to use it instead. Here's another example from my current Linux system:

$ w
USER     TTY      FROM          LOGIN@   IDLE   JCPU   PCPU WHAT
alvin pts/0    ip-address-here  21:23    0.00s  0.05s  0.02s sshd: alvin [priv]

As you can see, the additional information shown, including the "what" field, is very nice.