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".
9 top \- display and update information about the top cpu processes
28 .\" This defines appropriate quote strings for nroff and troff
33 .\" Just in case these number registers aren't set yet...
39 processes on the system and periodically updates this information.
42 If standard output is an intelligent terminal (see below) then
43 as many processes as will fit on the terminal screen are displayed
44 by default. Otherwise, a good number of them are shown (around 20).
46 Raw cpu percentage is used to rank the processes. If
48 is given, then the top
50 processes will be displayed instead of the default.
53 makes a distinction between terminals that support advanced capabilities
54 and those that do not. This
55 distinction affects the choice of defaults for certain options. In the
56 remainder of this document, an \*(lqintelligent\*(rq terminal is one that
57 supports cursor addressing, clear screen, and clear to end of line.
58 Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
59 features. If the output of
61 is redirected to a file, it acts as if it were being run on a dumb
66 Toggle CPU display mode.
67 By default top displays the weighted CPU percentage in the WCPU column
68 (this is the same value that
73 flag is passed it toggles between \*(lqraw cpu\*(rq mode
74 and \*(lqweighted cpu\*(rq mode, showing the \*(lqCPU\*(rq or
75 the \*(lqWCPU\*(rq column respectively.
78 Show system processes in the display. Normally, system processes such as
79 the pager and the swapper are not shown. This option makes them visible.
82 Display command names derived from the argv[] vector, rather than real
83 executable name. It's useful when you want to watch applications, that
84 puts their status information there. If the real name differs from argv[0],
85 it will be displayed in parenthesis.
88 Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is
89 ignored. Interrupt characters (such as ^C and ^\e) still have an effect.
90 This is the default on a dumb terminal, or when the output is not a terminal.
93 Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately
94 read for processing. See the section on \*(lqInteractive Mode\*(rq
96 which keys perform what functions. After the command is processed, the
97 screen will immediately be updated, even if the command was not
98 understood. This mode is the default when standard output is an
102 Do not display idle processes.
103 By default, top displays both active and idle processes.
116 Display either 'cpu' or 'io' statistics. Default is 'cpu'.
119 Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq
125 to -20 so that it will run faster. This can be used when the system is
126 being very sluggish to improve the possibility of discovering the problem.
127 This option can only be used by root.
130 Do not take the time to map uid numbers to usernames. Normally,
132 will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
133 all the user id numbers it encounters into login names. This option
134 disables all that, while possibly decreasing execution time. The uid
135 numbers are displayed instead of the names.
138 Write version number information to stderr then exit immediately.
139 No other processing takes place when this option is used. To see current
140 revision information while top is running, use the help command \*(lq?\*(rq.
145 displays, then exit. A display is considered to be one update of the
146 screen. This option allows the user to select the number of displays he
149 automatically exits. For intelligent terminals, no upper limit
150 is set. The default is 1 for dumb terminals.
153 Set the delay between screen updates to
155 seconds. The default delay between updates is \nD seconds.
158 Sort the process display area on the specified field. The field name is
159 the name of the column as seen in the output, but in lower case. Likely
160 values are \*(lqcpu\*(rq, \*(lqsize\*(rq, \*(lqres\*(rq, and \*(lqtime\*(rq,
161 but may vary on different operating systems. Note that
162 not all operating systems support this option.
165 Show only those processes owned by
167 This option currently only accepts usernames and will not understand
174 fields can be specified as \*(lqinfinite\*(rq, indicating that they can
175 stretch as far as possible. This is accomplished by using any proper
176 prefix of the keywords
183 on an intelligent terminal is, in fact,
186 The environment variable
188 is examined for options before the command line is scanned. This enables
189 a user to set his or her own defaults. The number of processes to display
190 can also be specified in the environment variable
198 are actually toggles. A second specification of any of these options
199 will negate the first. Thus a user who has the environment variable
201 set to \*(lq\-I\*(rq may use the command \*(lqtop \-I\*(rq to see idle processes.
202 .SH "INTERACTIVE MODE"
205 is running in \*(lqinteractive mode\*(rq, it reads commands from the
206 terminal and acts upon them accordingly. In this mode, the terminal is
207 put in \*(lqCBREAK\*(rq, so that a character will be
208 processed as soon as it is typed. Almost always, a key will be
211 is between displays; that is, while it is waiting for
213 seconds to elapse. If this is the case, the command will be
214 processed and the display will be updated immediately thereafter
215 (reflecting any changes that the command may have specified). This
216 happens even if the command was incorrect. If a key is pressed while
218 is in the middle of updating the display, it will finish the update and
219 then process the command. Some commands require additional information,
220 and the user will be prompted accordingly. While typing this information
221 in, the user's erase and kill keys (as set up by the command
223 are recognized, and a newline terminates the input.
225 These commands are currently recognized (^L refers to control-L):
229 .IP "\fBh\fP\ or\ \fB?\fP"
230 Display a summary of the commands (help screen). Version information
231 is included in this display.
238 Change the number of displays to show (prompt for new number).
239 Remember that the next display counts as one, so typing
243 show one final display and then immediately exit.
246 Toggle the display between 'cpu' and 'io' modes.
249 Change the number of processes to display (prompt for new number).
252 Change the number of seconds to delay between displays
253 (prompt for new number).
256 Toggle the display of system processes.
259 Toggle the display of process titles.
262 Send a signal (\*(lqkill\*(rq by default) to a list of processes. This
263 acts similarly to the command
267 Change the priority (the \*(lqnice\*(rq) of a list of processes.
268 This acts similarly to the command
272 Display only processes owned by a specific username (prompt for username).
273 If the username specified is simply \*(lq+\*(rq, then processes belonging
274 to all users will be displayed.
277 Change the order in which the display is sorted. This command is not
278 available on all systems. The sort key names vary from system to system
279 but usually include: \*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq,
280 \*(lqtime\*(rq. The default is cpu.
283 Display a list of system errors (if any) generated by the last
292 Toggle the display of idle processes.
295 Toggle the display of
300 Toggle the display of the
304 The actual display varies depending on the specific variant of Unix
305 that the machine is running. This description may not exactly match
306 what is seen by top running on this particular machine. Differences
307 are listed at the end of this manual entry.
309 The top few lines of the display show general information
310 about the state of the system, including
311 the last process id assigned to a process (on most systems),
312 the three load averages,
314 the number of existing processes,
315 the number of processes in each state
316 (sleeping, running, starting, zombies, and stopped),
317 and a percentage of time spent in each of the processor states
318 (user, nice, system, and idle).
319 It also includes information about physical and virtual memory allocation.
321 The remainder of the screen displays information about individual
322 processes. This display is similar in spirit to
324 but it is not exactly the same. PID is the process id,
325 JID, when displayed, is the
327 ID corresponding to the process,
328 USERNAME is the name of the process's owner (if
330 is specified, a UID column will be substituted for USERNAME),
331 PRI is the current priority of the process,
332 NICE is the nice amount (in the range \-20 to 20),
333 SIZE is the total size of the process (text, data, and stack),
334 RES is the current amount of resident memory (both SIZE and RES are
336 STATE is the current state (one of \*(lqSTART\*(rq, \*(lqRUN\*(rq
337 (shown as \*(lqCPUn\*(rq on SMP systems), \*(lqSLEEP\*(rq, \*(lqSTOP\*(rq,
338 \*(lqZOMB\*(rq, \*(lqWAIT\*(rq, \*(lqLOCK\*(rq or the event on which the
340 C is the processor number on which the process is executing
341 (visible only on SMP systems),
342 TIME is the number of system and user cpu seconds that the process has used,
343 WCPU, when displayed, is the weighted cpu percentage (this is the same
347 CPU is the raw percentage and is the field that is sorted to determine
348 the order of the processes, and
349 COMMAND is the name of the command that the process is currently running
350 (if the process is swapped out, this column is marked \*(lq<swapped>\*(rq).
352 The \*(lqABANDONED\*(rq state (known in the kernel as \*(lqSWAIT\*(rq) was
353 abandoned, thus the name. A process should never end up in this state.
355 William LeFebvre, EECS Department, Northwestern University
358 TOP user-configurable defaults for options.
361 /dev/kmem kernel memory
363 /dev/mem physical memory
365 /etc/passwd used to map uid numbers to user names
367 /boot/kernel/kernel system image
369 Don't shoot me, but the default for
371 has changed once again. So many people were confused by the fact that
373 wasn't showing them all the processes that I have decided to make the
374 default behavior show idle processes, just like it did in version 2.
375 But to appease folks who can't stand that behavior, I have added the
376 ability to set \*(lqdefault\*(rq options in the environment variable
378 (see the OPTIONS section). Those who want the behavior that version
379 3.0 had need only set the environment variable
383 The command name for swapped processes should be tracked down, but this
384 would make the program run slower.
388 things can change while
390 is collecting information for an update. The picture it gives is only a
391 close approximation to reality.