W(1)

NAME
w - who is on and what they are doing

SYNOPSIS
w [ -hs ]

DESCRIPTION
W is like who, except that the name of the process the user is currently talking to, and the CPU time used by the user since login and this process are printed.

The fields output are: the users login name, the name of the tty the user is on, the time of day the user logged on, the number of minutes since the user last typed anything, the CPU time used by all processes and their children on that terminal, the CPU time used by the current process, the name and arguments of the current process.

The -h flag suppresses the heading. The -s flag asks for a short form of output. In the short form, the tty is abbreviated, the login time and cpu times are left off, as are the arguments to commands.

The time printed above the user column is the current time of day. The load average numbers give the number of jobs in the run queue averaged over 1, 5 and 15 minutes.

FILES
/etc/utmp
/dev/kmem
/dev/drum

AUTHOR
Mark Horton

BUGS
The notion of the ``current process'' is muddy. The current algorithm is ``the highest numbered process on the terminal that is not ignoring interrupts, or, if there is none, the highest numbered process on the terminal''. This fails, for example, in critical sections of programs like the shell and editor. (In these cases, no process can be found and w prints ``-''.)

The CPU time is only an estimate, in particular, if someone leaves a background processs running after logging out, the person currently on that terminal is ``charged'' with the time.

Background processes are not shown, even though they account for much of the load on the system.

Some processes, typically those in the background, are printed with null or garbaged arguments, even though the process has not swapped. (Sometimes ps even loses on its own arguments!) In these cases, the name of the command is printed in parentheses.