source: trunk/third/top/top.X @ 16185

Revision 16185, 10.6 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r16184, which included commits to RCS files with non-trunk default branches.
Line 
1.\" NOTE:  changes to the manual page for "top" should be made in the
2.\"        file "top.X" and NOT in the file "top.1".
3.nr N %topn%
4.nr D %delay%
5.TH TOP 1 Local
6.UC 4
7.SH NAME
8top \- display and update information about the top cpu processes
9.SH SYNOPSIS
10.B top
11[
12.B \-SbiInquv
13] [
14.BI \-d count
15] [
16.BI \-s time
17] [
18.BI \-o field
19] [
20.BI \-U username
21] [
22.I number
23]
24.SH DESCRIPTION
25.\" This defines appropriate quote strings for nroff and troff
26.ds lq \&"
27.ds rq \&"
28.if t .ds lq ``
29.if t .ds rq ''
30.\" Just in case these number registers aren't set yet...
31.if \nN==0 .nr N 10
32.if \nD==0 .nr D 5
33.I Top
34displays the top
35.if !\nN==-1 \nN
36processes on the system and periodically updates this information.
37.if \nN==-1 \
38\{\
39If standard output is an intelligent terminal (see below) then
40as many processes as will fit on the terminal screen are displayed
41by default.  Otherwise, a good number of them are shown (around 20).
42.\}
43Raw cpu percentage is used to rank the processes.  If
44.I number
45is given, then the top
46.I number
47processes will be displayed instead of the default.
48.PP
49.I Top
50makes a distinction between terminals that support advanced capabilities
51and those that do not.  This
52distinction affects the choice of defaults for certain options.  In the
53remainder of this document, an \*(lqintelligent\*(rq terminal is one that
54supports cursor addressing, clear screen, and clear to end of line.
55Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
56features.  If the output of
57.I top
58is redirected to a file, it acts as if it were being run on a dumb
59terminal.
60.SH OPTIONS
61.TP
62.B \-S
63Show system processes in the display.  Normally, system processes such as
64the pager and the swapper are not shown.  This option makes them visible.
65.TP
66.B \-b
67Use \*(lqbatch\*(rq mode.  In this mode, all input from the terminal is
68ignored.  Interrupt characters (such as ^C and ^\e) still have an effect.
69This is the default on a dumb terminal, or when the output is not a terminal.
70.TP
71.B \-i
72Use \*(lqinteractive\*(rq mode.  In this mode, any input is immediately
73read for processing.  See the section on \*(lqInteractive Mode\*(rq
74for an explanation of
75which keys perform what functions.  After the command is processed, the
76screen will immediately be updated, even if the command was not
77understood.  This mode is the default when standard output is an
78intelligent terminal.
79.TP
80.B \-I
81Do not display idle processes.
82By default, top displays both active and idle processes.
83.TP
84.B \-n
85Use \*(lqnon-interactive\*(rq mode.  This is indentical to \*(lqbatch\*(rq
86mode.
87.TP
88.B \-q
89Renice
90.I top
91to -20 so that it will run faster.  This can be used when the system is
92being very sluggish to improve the possibility of discovering the problem.
93This option can only be used by root.
94.TP
95.B \-u
96Do not take the time to map uid numbers to usernames.  Normally,
97.I top
98will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
99all the user id numbers it encounters into login names.  This option
100disables all that, while possibly decreasing execution time.  The uid
101numbers are displayed instead of the names.
102.TP
103.B \-v
104Write version number information to stderr then exit immediately.
105No other processing takes place when this option is used.  To see current
106revision information while top is running, use the help command \*(lq?\*(rq.
107.TP
108.BI \-d count
109Show only
110.I count
111displays, then exit.  A display is considered to be one update of the
112screen.  This option allows the user to select the number of displays he
113wants to see before
114.I top
115automatically exits.  For intelligent terminals, no upper limit
116is set.  The default is 1 for dumb terminals.
117.TP
118.BI \-s time
119Set the delay between screen updates to
120.I time
121seconds.  The default delay between updates is \nD seconds.
122.TP
123.BI \-o field
124Sort the process display area on the specified field.  The field name is
125the name of the column as seen in the output, but in lower case.  Likely
126values are \*(lqcpu\*(rq, \*(lqsize\*(rq, \*(lqres\*(rq, and \*(lqtime\*(rq,
127but may vary on different operating systems.  Note that
128not all operating systems support this option.
129.TP
130.BI \-U username
131Show only those processes owned by
132.IR username .
133This option currently only accepts usernames and will not understand
134uid numbers.
135.PP
136Both
137.I count
138and
139.I number
140fields can be specified as \*(lqinfinite\*(rq, indicating that they can
141stretch as far as possible.  This is accomplished by using any proper
142prefix of the keywords
143\*(lqinfinity\*(rq,
144\*(lqmaximum\*(rq,
145or
146\*(lqall\*(rq.
147The default for
148.I count
149on an intelligent terminal is, in fact,
150.BI infinity .
151.PP
152The environment variable
153.B TOP
154is examined for options before the command line is scanned.  This enables
155a user to set his or her own defaults.  The number of processes to display
156can also be specified in the environment variable
157.BR TOP .
158The options
159.BR \-I ,
160.BR \-S ,
161and
162.B \-u
163are actually toggles.  A second specification of any of these options
164will negate the first.  Thus a user who has the environment variable
165.B TOP
166set to \*(lq\-I\*(rq may use the command \*(lqtop \-I\*(rq to see idle processes.
167.SH "INTERACTIVE MODE"
168When
169.I top
170is running in \*(lqinteractive mode\*(rq, it reads commands from the
171terminal and acts upon them accordingly.  In this mode, the terminal is
172put in \*(lqCBREAK\*(rq, so that a character will be
173processed as soon as it is typed.  Almost always, a key will be
174pressed when
175.I top
176is between displays; that is, while it is waiting for
177.I time
178seconds to elapse.  If this is the case, the command will be
179processed and the display will be updated immediately thereafter
180(reflecting any changes that the command may have specified).  This
181happens even if the command was incorrect.  If a key is pressed while
182.I top
183is in the middle of updating the display, it will finish the update and
184then process the command.  Some commands require additional information,
185and the user will be prompted accordingly.  While typing this information
186in, the user's erase and kill keys (as set up by the command
187.IR stty )
188are recognized, and a newline terminates the input.
189.PP
190These commands are currently recognized (^L refers to control-L):
191.TP
192.B ^L
193Redraw the screen.
194.IP "\fBh\fP\ or\ \fB?\fP"
195Display a summary of the commands (help screen).  Version information
196is included in this display.
197.TP
198.B q
199Quit
200.IR top.
201.TP
202.B d
203Change the number of displays to show (prompt for new number).
204Remember that the next display counts as one, so typing
205.B d1
206will make
207.I top
208show one final display and then immediately exit.
209.TP
210.B n or #
211Change the number of processes to display (prompt for new number).
212.TP
213.B s
214Change the number of seconds to delay between displays
215(prompt for new number).
216.TP
217.B k
218Send a signal (\*(lqkill\*(rq by default) to a list of processes.  This
219acts similarly to the command
220.IR kill (1)).
221.TP
222.B r
223Change the priority (the \*(lqnice\*(rq) of a list of processes.
224This acts similarly to the command
225.IR renice (8)).
226.TP
227.B u
228Display only processes owned by a specific username (prompt for username).
229If the username specified is simply \*(lq+\*(rq, then processes belonging
230to all users will be displayed.
231.TP
232.B o
233Change the order in which the display is sorted.  This command is not
234available on all systems.  The sort key names vary fron system to system
235but usually include:  \*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq,
236\*(lqtime\*(rq.  The default is cpu.
237.TP
238.B e
239Display a list of system errors (if any) generated by the last
240.BR k ill
241or
242.BR r enice
243command.
244.TP
245.B i
246(or
247.BR I)
248Toggle the display of idle processes.
249.SH "THE DISPLAY"
250The actual display varies depending on the specific variant of Unix
251that the machine is running.  This description may not exactly match
252what is seen by top running on this particular machine.  Differences
253are listed at the end of this manual entry.
254.PP
255The top few lines of the display show general information
256about the state of the system, including
257the last process id assigned to a process (on most systems),
258the three load averages,
259the current time,
260the number of existing processes,
261the number of processes in each state
262(sleeping, running, starting, zombies, and stopped),
263and a percentage of time spent in each of the processor states
264(user, nice, system, and idle).
265It also includes information about physial and virtual memory allocation.
266.PP
267The remainder of the screen displays information about individual
268processes.  This display is similar in spirit to
269.IR ps (1)
270but it is not exactly the same.  PID is the process id, USERNAME is the name
271of the process's owner (if
272.B \-u
273is specified, a UID column will be substituted for USERNAME),
274PRI is the current priority of the process,
275NICE is the nice amount (in the range \-20 to 20),
276SIZE is the total size of the process (text, data, and stack),
277RES is the current amount of resident memory (both SIZE and RES are
278given in kilobytes),
279STATE is the current state (one of \*(lqsleep\*(rq, \*(lqWAIT\*(rq,
280\*(lqrun\*(rq, \*(lqidl\*(rq, \*(lqzomb\*(rq, or \*(lqstop\*(rq),
281TIME is the number of system and user cpu seconds that the process has used,
282WCPU, when displayed, is the weighted cpu percentage (this is the same
283value that
284.IR ps (1)
285displays as CPU),
286CPU is the raw percentage and is the field that is sorted to determine
287the order of the processes, and
288COMMAND is the name of the command that the process is currently running
289(if the process is swapped out, this column is marked \*(lq<swapped>\*(rq).
290.SH NOTES
291The \*(lqABANDONED\*(rq state (known in the kernel as \*(lqSWAIT\*(rq) was
292abandoned, thus the name.  A process should never end up in this state.
293.SH AUTHOR
294William LeFebvre, EECS Department, Northwestern University
295.SH ENVIRONMENT
296.DT
297TOP     user-configurable defaults for options.
298.SH FILES
299.DT
300/dev/kmem               kernel memory
301.br
302/dev/mem                physical memory
303.br
304/etc/passwd             used to map uid numbers to user names
305.br
306/vmunix         system image
307.SH BUGS
308Don't shoot me, but the default for
309.B \-I
310has changed once again.  So many people were confused by the fact that
311.I top
312wasn't showing them all the processes that I have decided to make the
313default behavior show idle processes, just like it did in version 2.
314But to appease folks who can't stand that behavior, I have added the
315ability to set \*(lqdefault\*(rq options in the environment variable
316.B TOP
317(see the OPTIONS section).  Those who want the behavior that version
3183.0 had need only set the environment variable
319.B TOP
320to \*(lq\-I\*(rq.
321.PP
322The command name for swapped processes should be tracked down, but this
323would make the program run slower.
324.PP
325As with
326.IR ps (1),
327things can change while
328.I top
329is collecting information for an update.  The picture it gives is only a
330close approximation to reality.
331.SH "SEE ALSO"
332kill(1),
333ps(1),
334stty(1),
335mem(4),
336renice(8)
Note: See TracBrowser for help on using the repository browser.