Unix List Who Is on Server and What They Are Doing

Fig. 01: w command in action

Fig. 01: w command in action

The w command line utility shows a summary of the current activity on the Unix based system, including what each user is doing. The first line displays the current time of day, how long the system has been running, the number of users logged into the system, and the load averages. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes. The fields output are the user’s login name, the name of the terminalthe user is on, the host from which the user is logged in, the time the user logged on, the time since the user last typed anything, and the name and arguments of the current process.The syntax is:

w vivek
w root

Sample outputs:

17:28  up  5:54, 10 users, load averages: 1.52 1.42 1.42
USER     TTY      FROM              LOGIN@  IDLE WHAT
vivek    console  -                11:34    5:53 -
vivek    s000     -                14:05    3:17 ssh -X nas01
vivek    s001     -                14:37       6 ssh root@v.txvip1
vivek    s002     -                14:51    1:34 ssh root@nas01
vivek    s003     -                14:52       6 ssh nixcraft@nas01
vivek    s004     -                14:53    2:35 /Applications/LICEcap.app/Content
vivek    s005     -                14:56    1:22 -bash
vivek    s006     -                16:13    1:14 -bash
vivek    s007     -                17:21       6 ssh root@nas01
vivek    s008     -                17:25       - w
root     s009      17:30       - vi /etc/passwd

Examples and usage: Linux / Unix: w Command Examples