no more select kludge
[unix-history] / usr / src / usr.bin / w / w.1
CommitLineData
89124ab1
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
2c1ecc2d 5.\" @(#)w.1 6.1 (Berkeley) %G%
89124ab1 6.\"
2c1ecc2d 7.TH W 1 ""
89124ab1
KM
8.UC 4
9.SH NAME
10w \- who is on and what they are doing
11.SH SYNOPSIS
12.B w
13[
14.B \-h
15] [
16.B \-s
17] [ user ]
18.SH DESCRIPTION
19.I W
20prints a summary of the current activity on the system,
21including what each user is doing.
22The heading line shows the current time of day,
23how long the system has been up,
24the number of users logged into the system,
25and the load averages.
26The load average numbers give the number of jobs in the run queue
27averaged over 1, 5 and 15 minutes.
28.PP
29The fields output are:
30the users login name,
31the name of the tty the user is on,
32the time of day the user logged on,
33the number of minutes since the user last typed anything,
34the CPU time used by all processes and their children on that terminal,
35the CPU time used by the currently active processes,
36the name and arguments of the current process.
37.PP
38The
39.B \-h
40flag suppresses the heading.
41The
42.B \-s
43flag asks for a short form of output.
44In the short form, the tty is abbreviated, the login time and cpu times
45are left off, as are the arguments to commands.
46.B \-l
47gives the long output, which is the default.
48.PP
49If a
50.I user
51name is included,
52the output will be restricted to that user.
53.SH FILES
54.ta 1i
55/etc/utmp
56.br
57/dev/kmem
58.br
59/dev/drum
60.SH "SEE ALSO"
61who(1), finger(1), ps(1)
62.SH AUTHOR
63Mark Horton
64.SH BUGS
65The notion of the ``current process'' is muddy.
66The current algorithm is ``the highest numbered process on
67the terminal that is not ignoring interrupts,
68or, if there is none, the highest numbered process on the terminal''.
69This fails, for example, in critical sections of programs
70like the shell and editor,
71or when faulty programs running in the background
72fork and fail to ignore interrupts.
73(In cases where no process can be found,
74.I w
75prints ``\-''.)
76.PP
77The CPU time is only an estimate, in particular, if someone leaves a
78background process running after logging out, the person currently
79on that terminal is ``charged'' with the time.
80.PP
81Background processes are not shown, even though they account for
82much of the load on the system.
83.PP
84Sometimes processes, typically those in the background, are
85printed with null or garbaged arguments.
86In these cases, the name of the command is printed in parentheses.
87.PP
88W does not know about the new conventions for detection of background jobs.
89It will sometimes find a background job instead of the right one.