W - show how many users are logged on and how (local or remote) + system load

Easy explanation

$ w

First line, in man pages referred to as header shows the same stuff as uptime command.

07:04:10 up 1:10, 3 users, load average: 0.07, 0.13, 0.22

Other lines show descriptive information on users logged on


Shows username of user logged on.


The way how users are logged on through terminal, TTY is short for controlling terminal, if you see in you w command this output, it means that user mike is logged on through controlling terminal 7 as a gnome-session, this also tells you that when you are switched in other terminal or you have opened more terminals, that if you press Ctrl + Alt + F7, you will be switched the tty7 - the 7 is for F7.

Computer #1 (home PC)

mike tty7                   05:54    1:09m  2:43   0.27s gnome-session -

Other types of terminal is pts, this is short for Pseudo Terminal Slave, there is also ptmx that is pseudo terminal master, but I have not seen that in w window yet. It basically means user is connected to this computer using remote session.

Computer #1 (home PC)

mike tty7                   05:54    1:09m  2:43   0.27s gnome-session -
mike pts/0  :0              05:58   26.00s  0.06s  0.06s ssh -i

pts/0 tells you, that user mike is connected to other terminal using remote session, basically I have a opened terminal with ssh session to another computer, From :0 means that it is me, my computer that I am running this command from.

Now if we look on the computer, that I am connected to with this remote session, I enter w command there and I see:

Computer #2 (remote server)

07:38:34 up 1:31, 2 users, load average: 1.49, 1.41, 1.03
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
ubuntu   pts/0    chello456456456   06:09    1:30   0.57s  0.57s -bash
ubuntu   pts/1    chello456456456   07:38    2.00s  0.47s  0.00s w

Note that it says two users, it is just me, one person, but this is the way it does report, first line is me connected remotely from my other computer to this one using SSH, under WHAT it says -bash, I am connected to openssh server in terminal, in from it says my hostname of the computer #1, that I am connected from. It also tells that on the Computer #2 I entered w command into the terminal.


LOGIN@ means logged on at specific time.


IDLE is what it is, user has been idle for a specific amount of time.


JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, it does include  currently running background jobs.


PCPU time is the time used by the current process, named in the "what" field.