6 .Nd display and update information about the top cpu processes
19 processes on the system and periodically updates this information.
20 Raw cpu percentage is used to rank the processes.
23 makes a distinction between terminals that support advanced capabilities
24 and those that do not.
25 This distinction affects the choice of defaults for certain options.
26 In the remainder of this document, an
29 supports cursor addressing, clear screen, and clear to end of line.
32 terminal is one that does not support such features.
35 is redirected to a file, it acts as if it were being run on a dumb
38 .Bl -tag -width "-U username" -offset indent
40 Turn off the use of color in the display.
42 Do not display idle processes.
43 By default, top displays both active and idle processes.
45 Enable multi-CPU display.
47 Show system processes in the display.
48 Normally, system processes such as the pager and the swapper are not shown.
49 This option makes them visible.
51 List all available color tags and the current set of tests used for
52 color highlighting, then exit.
54 Show all processes for as long as possible.
56 .Dq Fl d Li all Li all .
57 This option is especially handy in batch mode.
62 In this mode, all input from the terminal is ignored.
63 Interrupt characters (such as ^C and ^\e) still have an effect.
64 This is the default on a dumb terminal, or when the output is not a terminal.
66 Show the full command line for each process.
67 Default is to show just the command name.
68 This option is not supported on all platforms.
73 In this mode, any input is immediately read for processing.
76 for an explanation of which keys perform what functions.
77 After the command is processed, the screen will immediately be updated,
78 even if the command was not understood.
79 This mode is the default when standard output is an intelligent terminal.
83 to \-20 so that it will run faster.
84 This can be used when the system is being very sluggish to improve the
85 possibility of discovering the problem.
86 This option can only be used by root.
88 Show individual threads on separate lines.
89 By default, on systems which support threading, each process is shown
90 with a count of the number of threads.
91 This option shows each thread on a separate line.
92 This option is not supported on all platforms.
94 Do not take the time to map uid numbers to usernames.
97 will read as much of the file
99 as is necessary to map all the user id numbers it encounters into login names.
100 This option disables all that, while possibly decreasing execution time.
101 The uid numbers are displayed instead of the names.
103 Write version number information to stderr then exit immediately.
104 No other processing takes place when this option is used.
105 To see current revision information while top is running,
112 A display is considered to be one update of the screen.
113 This option allows the user to select the number of displays he
117 Any proper prefix of the words
122 can be used to indicate an infinite number of displays.
123 The default for intelligent terminals is
125 The default for dumb terminals is
128 Start the display in an alternate mode.
129 Some platforms support multiple
130 process displays to show additional process information.
133 is a number indicating which mode to display.
136 On platforms that do not have multiple display modes this option has
139 Sort the process display area on the specified field.
140 The field name is the name of the column as seen in the output,
148 but may vary on different operating systems.
149 Note that not all operating systems support this option.
151 Set the delay between screen updates to
154 The default delay between updates is 5 seconds.
156 Show only those processes owned by
158 This option currently only accepts usernames and will not understand
164 is given, then the top
166 processes will be displayed instead of the default.
171 fields can be specified as
173 indicating that they can stretch as far as possible.
174 This is accomplished by using any proper prefix of the keywords
181 on an intelligent terminal is, in fact,
187 .Dq interactive mode ,
188 it reads commands from the terminal and acts upon them accordingly.
189 In this mode, the terminal is put in
191 so that a character will be processed as soon as it is typed.
192 Almost always, a key will be pressed when
194 is between displays; that is, while it is waiting for
197 If this is the case, the command will be
198 processed and the display will be updated immediately thereafter
199 (reflecting any changes that the command may have specified).
200 This happens even if the command was incorrect.
201 If a key is pressed while
203 is in the middle of updating the display, it will finish the update and
204 then process the command.
205 Some commands require additional information,
206 and the user will be prompted accordingly.
207 While typing this information
208 in, the user's erase and kill keys (as set up by the command
210 are recognized, and a newline terminates the input.
211 Note that a control\-L
212 (^L) always redraws the current screen and a space forces an immediate
213 update to the screen using new data.
215 These commands are currently recognized:
216 .Bl -tag -width "h or \&?" -offset indent
218 Display a summary of the commands (help screen).
219 Version information is included in this display.
221 Toggle the use of color in the display.
223 Display only processes whose commands match the specified string.
224 An empty string will display all processes.
225 This command is not supported on all platforms.
227 Change the number of displays to show (prompt for new number).
228 Remember that the next display counts as one, so typing
232 show one final display and then immediately exit.
234 Toggle the display of the full command line.
236 Toggle the display of threads on separate lines.
237 By default, on systems which support threading,
238 each process is shown with a count of the number of threads.
239 This command shows each thread on a separate line.
240 This command is not supported on all platforms.
242 Toggle the display of idle processes.
246 by default) to a list of processes.
247 This acts similarly to the command
250 Sort display by memory usage.
254 Change to a different process display mode.
255 Some systems provide multiple
256 display modes for the process display which shows different information.
257 This command toggles between the available modes.
258 This command is not supported on all platforms.
264 Change the number of processes to display (prompt for new number).
266 Change the order in which the display is sorted.
267 This command is not available on all systems.
268 The sort key names vary fron system to system,
285 Change the priority (the niceness) of a list of processes.
286 This acts similarly to the command
289 Change the number of seconds to delay between displays
290 (prompt for new number).
296 Toggle between displaying usernames and uids.
298 Display only processes owned by a specific username (prompt for username).
299 If the username specified is simply
301 then processes belonging to all users will be displayed.
304 The actual display varies depending on the specific variant of Unix
305 that the machine is running.
306 This description may not exactly match what is seen by top running on
307 this particular machine.
308 Differences are listed at the end of this manual entry.
310 The top lines of the display show general information
311 about the state of the system.
313 (on some systems) the last process id assigned to a process,
314 the three load averages,
315 the system uptime, and the current time.
316 The second line displays the total number of processes followed
317 by a breakdown of processes per state.
318 Examples of states common
319 to Unix systems are sleeping, running, starting, stopped, and zombie.
320 The next line displays a percentage of time spent in each of the
321 processor states (user, nice, system, interrupt, idle).
322 These percentages show the processor activity during the time since
324 For multi-processor systems, this information is an average of all processors.
325 The next line shows kernel-related activity (not available on all systems).
326 The numbers shown on this line are per-second rates sampled since the last
328 The exact information displayed varies between systems, but some examples are:
329 context switches, interrupts, traps, forks, and page faults.
331 The last two lines show a summary of memory and swap activity.
332 The fields are as follows:
333 .Bl -tag -width "Active:" -offset indent
335 number of pages active
337 number of pages inactive
339 number of pages wired down, including cached file data pages
341 number of pages used for VM-level disk caching
343 number of pages used for BIO-level disk caching
347 total available swap usage
349 total free swap usage
353 pages paged in from swap devices (last interval)
355 pages paged out to swap devices (last interval)
364 The remainder of the screen displays information about individual
366 This display is similar in spirit to
368 but it is not exactly the same.
369 The columns displayed by top will differ slightly between operating systems.
370 Generally, the following fields are displayed:
371 .Bl -tag -width "USERNAME" -offset indent
375 Username of the process's owner (if
377 is specified, a UID column will be substituted for USERNAME).
379 The number of threads in the processes (this column may also
382 Current priority of the process.
383 This field is no longer displayed.
385 Nice amount in the range \-20 to 20, as established by the use of
389 Total size of the process (text, data, and stack) given in kilobytes.
391 Proportional resident memory: current amount of process memory that resides
392 in physical memory, given in kilobytes.
393 Shared memory is divided among the processes doing the sharing.
394 This field replaces RES.
396 Current state (typically one of
404 Number of CPU the process is currently running on (only on multi-CPU machines).
406 Number of system and user cpu seconds that the process has used.
408 The cumulated CPU time of the process and its exited children.
409 This value is similar to what
411 displays as CPU time when run with the
415 Percentage of available cpu time used by this process.
417 Name of the command that the process is currently running.
420 Top supports the use of ANSI color in its output.
421 By default, color is available but not used.
422 The environment variable
424 specifies colors to use and conditions for which they should be used.
425 At the present time, only numbers in the summary display area can be
427 In a future version it will be possible to highlight numbers
428 in the process display area as well.
429 The environment variable is the only way to specify color:
430 there is no equivalent command line option.
431 Note that the environment variable
434 The British spelling takes precedence.
435 The use of color only works on terminals that understand and process
436 ANSI color escape sequences.
438 You can see a list of color codes recognized by this installation of top
442 This will also show the current set of tests used for
443 color highligting, as specified in the environment.
445 The following environment variables affect the execution of
447 .Bl -tag -width "TOPCOLORS"
449 The environment variable
451 is examined for options before the command line is scanned.
452 This enables a user to set his or her own defaults.
453 The number of processes to display
454 can also be specified in the environment variable
462 are actually toggles.
463 A second specification of any of these options will negate the first.
464 Thus a user who has the environment variable
470 to see idle processes.
472 The environment variable is a sequence of color specifications, separated
474 Each specification takes the form tag=min,max#code where
476 is the name of the value to check,
480 specify a range for the value, and
482 is an ANSI color code.
483 Multiple color codes can be listed and separated with semi-colons.
486 implies the lowest possible value (usually 0)
490 The comma must always be present.
491 When specifying numbers for load averages, they should be multiplied by 100.
492 For example, the specification
494 indicates that a 1 minute load average between
495 5 and 10 should be displayed in red.
496 Color attributes can be combined.
497 For example, the specification
499 indicates that a 5 minute load average higher than 10 should be displayed
500 with white characters on a red background.
503 is used to control the color of the header for process display.
504 It should be specified with no lower and upper limits, specifically
506 followed by the ANSI color code.
519 things can change while
521 is collecting information for an update.
522 The picture it gives is only a close approximation to reality.
524 .\" Copyright (C) 1984-2007 William LeFebvre.
525 .\" For additional licensing information, see
526 .\" http://www.unixtop.org/license/