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 .\" $FreeBSD: src/contrib/top/top.X,v 1.6.6.2 2002/08/11 17:09:25 dwmalone Exp $
4 .\" $DragonFly: src/contrib/top/top.X,v 1.5 2008/03/01 18:49:00 nant Exp $
10 top \- display and update information about the top cpu processes
27 .\" This defines appropriate quote strings for nroff and troff
32 .\" Just in case these number registers aren't set yet...
38 processes on the system and periodically updates this information.
41 If standard output is an intelligent terminal (see below) then
42 as many processes as will fit on the terminal screen are displayed
43 by default. Otherwise, a good number of them are shown (around 20).
45 Raw cpu percentage is used to rank the processes. If
47 is given, then the top
49 processes will be displayed instead of the default.
52 makes a distinction between terminals that support advanced capabilities
53 and those that do not. This
54 distinction affects the choice of defaults for certain options. In the
55 remainder of this document, an \*(lqintelligent\*(rq terminal is one that
56 supports cursor addressing, clear screen, and clear to end of line.
57 Conversely, a \*(lqdumb\*(rq terminal is one that does not support such
58 features. If the output of
60 is redirected to a file, it acts as if it were being run on a dumb
65 Show system processes in the display. Normally, system processes such as
66 the pager and the swapper are not shown. This option makes them visible.
69 Show kernel threads in the display. Normally, kernel threads such as
70 the pagedaemon and bufdaemon are not shown. This option makes them
74 Show only kernel threads.
75 This option implies the
80 Use \*(lqbatch\*(rq mode. In this mode, all input from the terminal is
81 ignored. Interrupt characters (such as ^C and ^\e) still have an effect.
82 This is the default on a dumb terminal, or when the output is not a terminal.
85 Use \*(lqinteractive\*(rq mode. In this mode, any input is immediately
86 read for processing. See the section on \*(lqInteractive Mode\*(rq
88 which keys perform what functions. After the command is processed, the
89 screen will immediately be updated, even if the command was not
90 understood. This mode is the default when standard output is an
94 Do not display idle processes.
95 By default, top displays both active and idle processes.
103 Use \*(lqnon-interactive\*(rq mode. This is identical to \*(lqbatch\*(rq
109 to -20 so that it will run faster. This can be used when the system is
110 being very sluggish to improve the possibility of discovering the problem.
111 This option can only be used by root.
114 Do not take the time to map uid numbers to usernames. Normally,
116 will read as much of the file \*(lq/etc/passwd\*(rq as is necessary to map
117 all the user id numbers it encounters into login names. This option
118 disables all that, while possibly decreasing execution time. The uid
119 numbers are displayed instead of the names.
122 Write version number information to stderr then exit immediately.
123 No other processing takes place when this option is used. To see current
124 revision information while top is running, use the help command \*(lq?\*(rq.
129 displays, then exit. A display is considered to be one update of the
130 screen. This option allows the user to select the number of displays he
133 automatically exits. For intelligent terminals, no upper limit
134 is set. The default is 1 for dumb terminals.
137 Set the delay between screen updates to
139 seconds. The default delay between updates is \nD seconds.
142 Sort the process display area on the specified field. The field name is
143 the name of the column as seen in the output, but in lower case. Likely
144 values are \*(lqcpu\*(rq, \*(lqsize\*(rq, \*(lqres\*(rq, and \*(lqtime\*(rq,
145 but may vary on different operating systems. Note that
146 not all operating systems support this option.
149 Show only those processes owned by
151 This option currently only accepts usernames and will not understand
158 fields can be specified as \*(lqinfinite\*(rq, indicating that they can
159 stretch as far as possible. This is accomplished by using any proper
160 prefix of the keywords
167 on an intelligent terminal is, in fact,
170 The environment variable
172 is examined for options before the command line is scanned. This enables
173 a user to set his or her own defaults. The number of processes to display
174 can also be specified in the environment variable
182 are actually toggles. A second specification of any of these options
183 will negate the first. Thus a user who has the environment variable
185 set to \*(lq\-I\*(rq may use the command \*(lqtop \-I\*(rq to see idle processes.
186 .SH "INTERACTIVE MODE"
189 is running in \*(lqinteractive mode\*(rq, it reads commands from the
190 terminal and acts upon them accordingly. In this mode, the terminal is
191 put in \*(lqCBREAK\*(rq, so that a character will be
192 processed as soon as it is typed. Almost always, a key will be
195 is between displays; that is, while it is waiting for
197 seconds to elapse. 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). This
200 happens even if the command was incorrect. If a key is pressed while
202 is in the middle of updating the display, it will finish the update and
203 then process the command. Some commands require additional information,
204 and the user will be prompted accordingly. While typing this information
205 in, the user's erase and kill keys (as set up by the command
207 are recognized, and a newline terminates the input.
209 These commands are currently recognized (^L refers to control-L):
213 .IP "\fBh\fP\ or\ \fB?\fP"
214 Display a summary of the commands (help screen). Version information
215 is included in this display.
218 Display system processes.
221 Display kernel threads, such as bufdaemon and pagedaemon.
224 Toggle displaying of only kernel threads.
231 Change the number of displays to show (prompt for new number).
232 Remember that the next display counts as one, so typing
236 show one final display and then immediately exit.
239 Change the number of processes to display (prompt for new number).
242 Change the number of seconds to delay between displays
243 (prompt for new number).
246 Send a signal (\*(lqkill\*(rq by default) to a list of processes. This
247 acts similarly to the command
251 Change the priority (the \*(lqnice\*(rq) of a list of processes.
252 This acts similarly to the command
256 Display only processes owned by a specific username (prompt for username).
257 If the username specified is simply \*(lq+\*(rq, then processes belonging
258 to all users will be displayed.
261 Change the order in which the display is sorted. This command is not
262 available on all systems. The sort key names vary fron system to system
263 but usually include: \*(lqcpu\*(rq, \*(lqres\*(rq, \*(lqsize\*(rq,
264 \*(lqtime\*(rq. The default is cpu.
267 Display a list of system errors (if any) generated by the last
276 Toggle the display of idle processes.
279 Toggle the display of the
283 The actual display varies depending on the specific variant of Unix
284 that the machine is running. This description may not exactly match
285 what is seen by top running on this particular machine. Differences
286 are listed at the end of this manual entry.
288 The top few lines of the display show general information
289 about the state of the system, including
290 the last process id assigned to a process (on most systems),
291 the three load averages,
293 the number of existing processes,
294 the number of processes in each state
295 (sleeping, running, starting, zombies, and stopped),
296 and a percentage of time spent in each of the processor states
297 (user, nice, system, and idle).
298 It also includes information about physical and virtual memory allocation.
300 The remainder of the screen displays information about individual
301 processes. This display is similar in spirit to
303 but it is not exactly the same. PID is the process id, USERNAME is the name
304 of the process's owner (if
306 is specified, a UID column will be substituted for USERNAME),
307 PRI is the current priority of the process,
308 NICE is the nice amount (in the range \-20 to 20),
309 SIZE is the total size of the process (text, data, and stack),
310 RES is the current amount of resident memory (both SIZE and RES are
312 STATE is the current state (one of \*(lqsleep\*(rq, \*(lqWAIT\*(rq,
313 \*(lqrun\*(rq, \*(lqidl\*(rq, \*(lqzomb\*(rq, or \*(lqstop\*(rq),
314 TIME is the number of system and user cpu seconds that the process has used,
315 WCPU, when displayed, is the weighted cpu percentage (this is the same
319 CPU is the raw percentage and is the field that is sorted to determine
320 the order of the processes, and
321 COMMAND is the name of the command that the process is currently running
322 (if the process is swapped out, this column is marked \*(lq<swapped>\*(rq).
324 The \*(lqABANDONED\*(rq state (known in the kernel as \*(lqSWAIT\*(rq) was
325 abandoned, thus the name. A process should never end up in this state.
327 William LeFebvre, EECS Department, Northwestern University
330 TOP user-configurable defaults for options.
333 /dev/kmem kernel memory
335 /dev/mem physical memory
337 /etc/passwd used to map uid numbers to user names
341 Don't shoot me, but the default for
343 has changed once again. So many people were confused by the fact that
345 wasn't showing them all the processes that I have decided to make the
346 default behavior show idle processes, just like it did in version 2.
347 But to appease folks who can't stand that behavior, I have added the
348 ability to set \*(lqdefault\*(rq options in the environment variable
350 (see the OPTIONS section). Those who want the behavior that version
351 3.0 had need only set the environment variable
355 The command name for swapped processes should be tracked down, but this
356 would make the program run slower.
360 things can change while
362 is collecting information for an update. The picture it gives is only a
363 close approximation to reality.