1 .\" NOTE: changes to the manual page for "top" should be made in the
2 .\" file "top.1.in" and NOT in the file "top.1".
5 .nr L @HAVE_GETOPT_LONG@
10 top \- display and update information about the top cpu processes
31 .\" This defines appropriate quote strings for nroff and troff
36 .\" Just in case these number registers aren't set yet...
42 processes on the system and periodically updates this information.
45 If standard output is an intelligent terminal (see below) then
46 as many processes as will fit on the terminal screen are displayed
47 by default. Otherwise, a good number of them are shown (around 20).
49 Raw cpu percentage is used to rank the processes. If
51 is given, then the top
53 processes will be displayed instead of the default.
56 makes a distinction between terminals that support advanced capabilities
57 and those that do not. This
58 distinction affects the choice of defaults for certain options. In the
59 remainder of this document, an \*(lqintelligent\*(rq terminal is one that
60 supports cursor addressing, clear screen, and clear to end of line.
61 Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
62 features. If the output of
64 is redirected to a file, it acts as if it were being run on a dumb
67 .if \nL==0 Long options are not available on this system.
69 .B "\-1, \-\-percpustates"
70 Display per-cpu states on a multi-processor machine.
73 Turn off the use of color in the display.
75 .B "\-I, \-\-idle-procs"
76 Do not display idle processes.
77 By default, top displays both active and idle processes.
79 .B "\-S, \-\-system-procs"
80 Show system processes in the display. Normally, system processes such as
81 the pager and the swapper are not shown. This option makes them visible.
83 .B "\-T, \-\-tag-names"
84 List all available color tags and the current set of tests used for
85 color highlighting, then exit.
88 Show all processes for as long as possible. This is shorthand for
89 \*(lq-d all all\*(rq. This option is especially handy in batch mode.
91 .B "\-b, \-n, \-\-batch"
92 Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is
93 ignored. Interrupt characters (such as ^C and ^\e) still have an effect.
94 This is the default on a dumb terminal, or when the output is not a terminal.
96 .B "\-c, \-\-full-commands"
97 Show the full command line for each process. Default is to show just the
98 command name. This option is not supported on all platforms.
100 .B "\-i, \-\-interactive"
101 Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately
102 read for processing. See the section on \*(lqInteractive Mode\*(rq
103 for an explanation of
104 which keys perform what functions. After the command is processed, the
105 screen will immediately be updated, even if the command was not
106 understood. This mode is the default when standard output is an
107 intelligent terminal.
112 to -20 so that it will run faster. This can be used when the system is
113 being very sluggish to improve the possibility of discovering the problem.
114 This option can only be used by root.
116 .B "\-t, \-\-threads"
117 Show individual threads on separate lines. By default, on systems
118 which support threading, each process is shown with a count of the number
119 of threads. This option shows each thread on a separate line. This option
120 is not supported on all platforms.
123 Do not take the time to map uid numbers to usernames. Normally,
125 will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
126 all the user id numbers it encounters into login names. This option
127 disables all that, while possibly decreasing execution time. The uid
128 numbers are displayed instead of the names.
130 .B "\-v, \-\-version"
131 Write version number information to stderr then exit immediately.
132 No other processing takes place when this option is used. To see current
133 revision information while top is running, use the help command \*(lq?\*(rq.
135 .B "\-d \fIcount\fP, \-\-displays \fIcount\fP"
138 displays, then exit. A display is considered to be one update of the
139 screen. This option allows the user to select the number of displays he
142 automatically exits. Any proper prefix of the words \*(lqinfinity\*(rq,
145 \*(lqall\*(rq can be used to indicate an infinite number of displays.
146 The default for intelligent terminals is infinity.
147 The default for dumb terminals is 1.
149 .B "\-m \fImode\fP, \-\-mode=\fImode\fP"
150 Start the display in an alternate mode. Some platforms support multiple
151 process displays to show additional process information. The value
152 \fImode\fP is a number indicating which mode to display. The default is
153 0. On platforms that do not have multiple display modes this option has
156 .B "\-o \fIfield\fP, \-\-sort-order=\fIfield\fP"
157 Sort the process display area on the specified field. The field name is
158 the name of the column as seen in the output, but in lower case. Likely
159 values are \*(lqcpu\*(rq, \*(lqsize\*(rq, \*(lqres\*(rq, and \*(lqtime\*(rq,
160 but may vary on different operating systems. Note that
161 not all operating systems support this option.
163 .B "\-p \fIpid\fP, \-\-pid=\fIpid\fP"
164 Only display the specified pid.
166 .B "\-s \fItime\fP, \-\-delay=\fItime\fP"
167 Set the delay between screen updates to
169 seconds. The default delay between updates is
173 .B "\-U \fIusername\fP, \-\-user=\fIusername\fP"
174 Show only those processes owned by
176 This option currently only accepts usernames and will not understand
183 fields can be specified as \*(lqinfinite\*(rq, indicating that they can
184 stretch as far as possible. This is accomplished by using any proper
185 prefix of the keywords
192 on an intelligent terminal is, in fact,
195 The environment variable
197 is examined for options before the command line is scanned. This enables
198 a user to set his or her own defaults. The number of processes to display
199 can also be specified in the environment variable
207 are actually toggles. A second specification of any of these options
208 will negate the first. Thus a user who has the environment variable
210 set to \*(lq\-I\*(rq may use the command \*(lqtop \-I\*(rq to see idle processes.
211 .SH "INTERACTIVE MODE"
214 is running in \*(lqinteractive mode\*(rq, it reads commands from the
215 terminal and acts upon them accordingly. In this mode, the terminal is
216 put in \*(lqCBREAK\*(rq, so that a character will be
217 processed as soon as it is typed. Almost always, a key will be
220 is between displays; that is, while it is waiting for
222 seconds to elapse. If this is the case, the command will be
223 processed and the display will be updated immediately thereafter
224 (reflecting any changes that the command may have specified). This
225 happens even if the command was incorrect. If a key is pressed while
227 is in the middle of updating the display, it will finish the update and
228 then process the command. Some commands require additional information,
229 and the user will be prompted accordingly. While typing this information
230 in, the user's erase and kill keys (as set up by the command
232 are recognized, and a newline terminates the input. Note that a control-L
233 (^L) always redraws the current screen and a space forces an immediate
234 update to the screen using new data.
236 These commands are currently recognized:
238 .I "\fBh\fP\ or\ \fB?\fP"
239 Display a summary of the commands (help screen). Version information
240 is included in this display.
243 Toggle the display of per-cpu states.
246 Toggle the use of color in the display.
249 Display only processes whose commands match the specified string. An empty
250 string will display all processes. This command is not supported on all
254 Change the number of displays to show (prompt for new number).
255 Remember that the next display counts as one, so typing
259 show one final display and then immediately exit.
262 Toggle the display of the full command line.
265 Toggle the display of threads on separate lines. By default, on systems
266 which support threading, each process is shown with a count of the number
267 of threads. This command shows each thread on a separate line. This command
268 is not supported on all platforms.
273 Toggle the display of idle processes.
277 Send a signal (\*(lqkill\*(rq by default) to a list of processes. This
278 acts similarly to the command
283 Sort display by memory usage. Shorthand for \*(lqo size\*(rq.
286 Change to a different process display mode. Some systems provide multiple
287 display modes for the process display which shows different information.
288 This command toggles between the available modes. This command is not
289 supported on all platforms.
292 Sort by process id. Shorthand for \*(lqo pid\*(rq.
295 Change the number of processes to display (prompt for new number).
298 Change the order in which the display is sorted. This command is not
299 available on all systems. The sort key names vary fron system to system
300 but usually include: \*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq,
301 \*(lqtime\*(rq. The default is cpu.
304 Sort by CPU usage. Shorthand for \*(lqo cpu\*(rq.
312 Change the priority (the \*(lqnice\*(rq) of a list of processes.
313 This acts similarly to the command
318 Change the number of seconds to delay between displays
319 (prompt for new number).
322 Sort by CPU time. Shorthand for \*(lqo time\*(rq.
325 Toggle between displaying usernames and uids.
328 Display only processes owned by a specific username (prompt for username).
329 If the username specified is simply \*(lq+\*(rq, then processes belonging
330 to all users will be displayed.
332 The actual display varies depending on the specific variant of Unix
333 that the machine is running. This description may not exactly match
334 what is seen by top running on this particular machine. Differences
335 are listed at the end of this manual entry.
337 The top lines of the display show general information
338 about the state of the system. The first line shows
339 (on some systems) the last process id assigned to a process,
340 the three load averages,
341 the system uptime, and the current time.
342 The second line displays the total number of processes followed
343 by a breakdown of processes per state. Examples of states common
344 to Unix systems are sleeping, running, starting, stopped, and zombie.
345 The next line displays a percentage of time spent in each of the
346 processor states (typically user, nice, system, idle, and iowait).
347 These percentages show the processor activity during the time since
348 the last update. For multi-processor systems, this information is
349 a summation of time across all processors. The next line shows
350 kernel-related activity (not available on all systems). The numbers
351 shown on this line are per-second rates sampled since the last update.
353 information displayed varies between systems, but some examples are:
354 context switches, interrupts, traps, forks, and page faults. The last
355 one or two lines show a summary of memory and swap activity. These lines
356 vary between systems.
358 The remainder of the screen displays information about individual
359 processes. This display is similar in spirit to
361 but it is not exactly the same. The columns displayed by top will
362 differ slightly between operating systems. Generally, the following
363 fields are displayed:
369 Username of the process's owner (if
371 is specified, a UID column will be substituted for USERNAME).
374 The number of threads in the processes (this column may also
378 Current priority of the process.
381 Nice amount in the range \-20 to 20, as established by the use of
386 Total size of the process (text, data, and stack) given in kilobytes.
389 Resident memory: current amount of process memory that resides in physical
390 memory, given in kilobytes.
393 Current state (typically one of \*(lqsleep\*(rq,
394 \*(lqrun\*(rq, \*(lqidl\*(rq, \*(lqzomb\*(rq, or \*(lqstop\*(rq).
397 Number of system and user cpu seconds that the process has used.
400 Percentage of available cpu time used by this process.
403 Name of the command that the process is currently running.
405 Top supports the use of ANSI color in its output. By default, color is
406 available but not used. The environment variable
408 specifies colors to use and conditions for which they should be used.
409 At the present time, only numbers in the summay display area can be
410 colored. In a future version it will be possible to highlight numbers
411 in the process display area as well. The environment variable is the
412 only way to specify color: there is no equivalent command line option.
413 Note that the environment variable
415 is also understood. The British spelling takes precedence. The use of
416 color only works on terminals that understand and process ANSI color
419 The environment variable is a sequence of color specifications, separated
420 by colons. Each specification takes the form tag=min,max#code where
422 is the name of the value to check,
426 specify a range for the value, and
428 is an ANSI color code. Multiple color codes can be listed and separated
429 with semi-colons. A missing
431 implies the lowest possible value (usually 0)
434 implies infinity. The comma must always be present. When specifying numbers
435 for load averages, they should be multiplied by 100.
436 For example, the specification
438 indicates that a 1 minute load average between
439 5 and 10 should be displayed in red. Color attributes can be combined.
440 For example, the specification
442 indicates that a 5 minute load average higher than 10 should be displayed
443 with white characters on a red background. A special tag named
445 is used to control the color of the header for process display. It should
446 be specified with no lower and upper limits, specifically
448 followed by the ANSI color code.
450 You can see a list of color codes recognized by this installation of top
453 option. This will also show the current set of tests used for
454 color highligting, as specified in the environment.
459 TOP user-configurable defaults for options.
460 TOPCOLORS color specification
464 things can change while
466 is collecting information for an update. The picture it gives is only a
467 close approximation to reality.
476 Copyright (C) 1984-2007 William LeFebvre. For additional licensing
477 information, see http://www.unixtop.org/license/