W(1) COMMAND REFERENCE W(1)
NAME
w - who is on and what they are doing
SYNOPSIS
w [ -h ] [ -s ] [ -u ] [ user ]
DESCRIPTION
W prints a summary of the current activity on the system,
including what each user is doing. The output looks like:
11:48am up 14:38, 3 users, load average: 0.09, 0.37, 1.03
User tty login@ idle JCPU PCPU what
root console 7:11am 9 3:50 5 -sh
chris tty03 8:36am 2 6:50 1:10 cc main.c
terry tty05 8:28am 4:37 27 vi calendar
The first line gives the current time of day, how long the
system has been up, 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 one,
five, and 15 minutes.
The second line gives the field headings: the user's
loginname, 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 tty, the CPU time used by the
currently active processes, and the name and arguments of
the current process.
OPTIONS
-h The printing of the first two lines (load average and
heading) is suppressed.
-s The output is printed in short form. The tty is
abbreviated; login time, CPU times, and arguments to
commands are omitted.
-u Only the first line (load average) is printed.
user
The output is restricted to the specified user.
FILES
/etc/utmp Accounting file.
/dev/cvt Table of kernel symbols.
/dev/kmem Image of kernel memory.
Printed 10/17/86 1
W(1) COMMAND REFERENCE W(1)
/dev/mem Image of physical memory.
/dev/drum Image of swap space.
DIAGNOSTICS
Can't read kernel symbols
W could not read kernel symbols from /dev/cvt (see
cvt(4)).
No kmem
W could not open /dev/kmem for reading.
No drum
W could not open /dev/drum for reading.
No mem
W could not open /dev/mem for reading.
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
CAVEATS
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, or when faulty programs running in the background
fork and fail to ignore interrupts. (In cases where no
process can be found, w prints a dash (-).)
The CPU time is only an estimate; in particular, if someone
leaves a background process 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.
Sometimes processes, typically those in the background, are
printed with null or garbaged arguments. In these cases,
the name of the command is printed in parentheses.
W does not know about the new conventions for detection of
background jobs. It will sometimes find a background job
instead of the right one.
Printed 10/17/86 2
W(1) COMMAND REFERENCE W(1)
Things can change while w is running; the picture it gives
is only a close approximation of reality. For instance, w
may produce false error messages if it cannot find a
particular file or if a data structure it is looking at
changes underneath it.
SEE ALSO
who(1n), finger(1n), ps(1), uptime(1n), cvt(4).
Printed 10/17/86 3
%%index%%
na:72,73;
sy:145,145;
de:290,1240;
op:1530,494;
fi:2024,234;2402,135;
di:2537,537;
rv:3074,338;
ca:3412,1212;4768,288;
se:5056,204;
%%index%%000000000165