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