Penguin
Annotated edit history of top(1) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 TOP
2 !!!TOP
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 COMMAND-LINE OPTIONS
7 FIELD DESCRIPTIONS
8 INTERACTIVE COMMANDS
9 The Field and Order Screens
10 Configuration Files
11 NOTES
12 FILES
13 SEE ALSO
14 BUGS
15 AUTHOR
16 ----
17 !!NAME
18
19
20 top - display top CPU processes
21 !!SYNOPSIS
22
23
24 __top__ [[__-__] [[__d__ ''delay''] [[__p__
25 ''pid''] [[__q__] [[__c__] [[__C__] [[__S__]
26 [[__s__] [[__i__] [[__n__ ''iter'']
27 [[__b__]
28 !!DESCRIPTION
29
30
31 __top__ provides an ongoing look at processor activity in
32 real time. It displays a listing of the most CPU-intensive
33 tasks on the system, and can provide an interactive
34 interface for manipulating processes. It can sort the tasks
35 by CPU usage, memory usage and runtime. can be better
36 configured than the standard top from the procps suite. Most
37 features can either be selected by an interactive command or
38 by specifying the feature in the personal or system-wide
39 configuration file. See below for more
40 information.
41 !!COMMAND-LINE OPTIONS
42
43
44 __d__
45
46
47 Specifies the delay between screen updates. You can change
48 this with the __s__ interactive command.
49
50
51 __p__
52
53
54 Monitor only processes with given process id. This flag can
55 be given up to twenty times. This option is neither
56 available interactively nor can it be put into the
57 configuration file.
58
59
60 __q__
61
62
63 This causes __top__ to refresh without any delay. If the
64 caller has superuser priviledges, top runs with the highest
65 possible priority.
66
67
68 __S__
69
70
71 Specifies cumulative mode, where each process is listed with
72 the CPU time that it ''as well as its dead children'' has
73 spent. This is like the __-S__ flag to ps(1). See
74 the discussion below of the __S__ interactive
75 command.
76
77
78 __s__
79
80
81 Tells __top__ to run in secure mode. This disables the
82 potentially dangerous of the interactive commands (see
83 below). A secure __top__ is a nifty thing to leave
84 running on a spare terminal.
85
86
87 __i__
88
89
90 Start __top__ ignoring any idle or zombie processes. See
91 the interactive command __i__ below.
92
93
94 __C__
95
96
97 display total CPU states in addition to individual CPUs.
98 This option only affects SMP systems.
99
100
101 __c__
102
103
104 display command line instead of the command name only. The
105 default behaviour has been changed as this seems to be more
106 useful.
107
108
109 __n__
110
111
112 Number of iterations. Update the display this number of
113 times and then exit.
114
115
116 __b__
117
118
119 Batch mode. Useful for sending output from top to other
120 programs or to a file. In this mode, __top__ will not
121 accept command line input. It runs until it produces the
122 number of iterations requested with the __n__ option or
123 until killed. Output is plain text suitable for display on a
124 dumb terminal.
125 !!FIELD DESCRIPTIONS
126
127
128 __top__ displays a variety of information about the
129 processor state. The display is updated every 5 seconds by
130 default, but you can change that with the __d__
131 command-line option or the __s__ interactive
132 command.
133
134
135 __uptime__
136
137
138 This line displays the time the system has been up, and the
139 three load averages for the system. The load averages are
140 the average number of process ready to run during the last
141 1, 5 and 15 minutes. This line is just like the output of
142 uptime(1). The uptime display may be toggled by the
143 interactive __l__ command.
144
145
146 __processes__
147
148
149 The total number of processes running at the time of the
150 last update. This is also broken down into the number of
151 tasks which are running, sleeping, stopped, or undead. The
152 processes and states display may be toggled by the __t__
153 interactive command.
154
155
156 __CPU states__
157
158
159 Shows the percentage of CPU time in user mode, system mode,
160 niced tasks, and idle. (Niced tasks are only those whose
161 nice value is negative.) Time spent in niced tasks will also
162 be counted in system and user time, so the total will be
163 more than 100%. The processes and states display may be
164 toggled by the __t__ interactive command.
165
166
167 __Mem__
168
169
170 Statistics on memory usage, including total available
171 memory, free memory, used memory, shared memory, and memory
172 used for buffers. The display of memory information may be
173 toggled by the __m__ interactive command.
174
175
176 __Swap__
177
178
179 Statistics on swap space, including total swap space,
180 available swap space, and used swap space. This and
181 __Mem__ are just like the output of
182 free(1).
183
184
185 __PID__
186
187
188 The process ID of each task.
189
190
191 __PPID__
192
193
194 The parent process ID each task.
195
196
197 __UID__
198
199
200 The user ID of the task's owner.
201
202
203 __USER__
204
205
206 The user name of the task's owner.
207
208
209 __PRI__
210
211
212 The priority of the task.
213
214
215 __NI__
216
217
218 The nice value of the task. Negative nice values are higher
219 priority.
220
221
222 __SIZE__
223
224
225 The size of the task's code plus data plus stack space, in
226 kilobytes, is shown here.
227
228
229 __TSIZE__
230
231
232 The code size of the task. This gives strange values for
233 kernel processes and is broken for ELF
234 processes.
235
236
237 __DSIZE__
238
239
240 Data + Stack size. This is broken for ELF
241 processes.
242
243
244 __TRS__
245
246
247 Text resident size.
248
249
250 __SWAP__
251
252
253 Size of the swapped out part of the task.
254
255
256 __D__
257
258
259 Size of pages marked dirty.
260
261
262 __LC__
263
264
265 Last used processor. (That this changes from time to time is
266 not a bug; Linux intentionally uses weak affinity. Also
267 notice that the very act of running top may break weak
268 affinity and cause more processes to change current CPU more
269 often because of the extra demand for CPU
270 time.)
271
272
273 __RSS__
274
275
276 The total amount of physical memory used by the task, in
277 kilobytes, is shown here. For ELF processes used library
278 pages are counted here, for a.out processes
279 not.
280
281
282 __SHARE__
283
284
285 The amount of shared memory used by the task is shown in
286 this column.
287
288
289 __STAT__
290
291
292 The state of the task is shown here. The state is either
293 __S__ for sleeping, __D__ for uninterruptible sleep,
294 __R__ for running, __Z__ for zombies, or __T__ for
295 stopped or traced. These states are modified by trailing
296 ____ for a process with negative nice value, __N__
297 for a process with positive nice value, __W__ for a
298 swapped out process (this does not work correctly for kernel
299 processes).
300
301
302 __WCHAN__
303
304
305 depending on the availablity of either
306 ''/boot/psdatabase'' or the kernel link map
307 ''/boot/System.map'' this shows the address or the name
308 of the kernel function the task currently is sleeping
309 in.
310
311
312 __TIME__
313
314
315 Total CPU time the task has used since it started. If
316 cumulative mode is on, this also includes the CPU time used
317 by the process's children which have died. You can set
318 cumulative mode with the __S__ command line option or
319 toggle it with the interactive command __S__. The header
320 line will then be changed to __CTIME__.
321
322
323 __%CPU__
324
325
326 The task's share of the CPU time since the last screen
327 update, expressed as a percentage of total CPU time per
328 processor.
329
330
331 __%MEM__
332
333
334 The task's share of the physical memory.
335
336
337 __COMMAND__
338
339
340 The task's command name, which will be truncated if it is
341 too long to be displayed on one line. Tasks in memory will
342 have a full command line, but swapped-out tasks will only
343 have the name of the program in parentheses (for example,
344
345
346 __A , WP__
347
348
349 these fields from the kmem top are not
350 supported.
351 !!INTERACTIVE COMMANDS
352
353
354 Several single-key commands are recognized while __top__
355 is running. Some are disabled if the __s__ option has
356 been given on the command line.
357
358
359 __space__
360
361
362 Immediately updates the display.
363
364
365 __^L__
366
367
368 Erases and redraws the screen.
369
370
371 __h__ or __?__
372
373
374 Displays a help screen giving a brief summary of commands,
375 and the status of secure and cumulative modes.
376
377
378 __k__
379
380
381 Kill a process. You will be prompted for the PID of the
382 task, and the signal to send to it. For a normal kill, send
383 signal 15. For a sure, but rather abrupt, kill, send signal
384 9. The default signal, as with kill(1), is 15,
385 __SIGTERM__. This command is not available in secure
386 mode.
387
388
389 __i__
390
391
392 Ignore idle and zombie processes. This is a toggle
393 switch.
394
395
396 __I__
397
398
399 Toggle between Solaris (CPU percentage divided by total
400 number of CPUs) and Irix (CPU percentage calculated solely
401 by amount of time) views. This is a toggle switch that
402 affects only SMP systems.
403
404
405 __n__ or __#__
406
407
408 Change the number of processes to show. You will be prompted
409 to enter the number. This overrides automatic determination
410 of the number of processes to show, which is based on window
411 size measurement. If 0 is specified, then top will show as
412 many processes as will fit on the screen; this is the
413 default.
414
415
416 __q__
417
418
419 Quit.
420
421
422 __r__
423
424
425 Re-nice a process. You will be prompted for the PID of the
426 task, and the value to nice it to. Entering a positve value
427 will cause a process to be niced to negative values, and
428 lose priority. If root is running __top__, a negative
429 value can be entered, causing a process to get a higher than
430 normal priority. The default renice value is 10. This
431 command is not available in secure mode.
432
433
434 __S__
435
436
437 This toggles cumulative mode, the equivalent of __ps
438 -S__, i.e., that CPU times will include a process's
439 defunct children. For some programs, such as compilers,
440 which work by forking into many seperate tasks, normal mode
441 will make them appear less demanding than they actually are.
442 For others, however, such as shells and __init__, this
443 behavior is correct. In any case, try cumulative mode for an
444 alternative view of CPU use.
445
446
447 __s__
448
449
450 Change the delay between updates. You will be prompted to
451 enter the delay time, in seconds, between updates.
452 Fractional values are recognized down to microseconds.
453 Entering 0 causes continuous updates. The default value is 5
454 seconds. Note that low values cause nearly unreadably fast
455 displays, and greatly raise the load. This command is not
456 available in secure mode.
457
458
459 __f__ or __F__
460
461
462 Add fields to display or remove fields from the display. See
463 below for more information.
464
465
466 __o__ or __O__
467
468
469 Change order of displayed fields. See below for more
470 information.
471
472
473 __l__
474
475
476 toggle display of load average and uptime
477 information.
478
479
480 __m__
481
482
483 toggle display of memory information.
484
485
486 __t__
487
488
489 toggle display of processes and CPU states
490 information.
491
492
493 __c__
494
495
496 toggle display of command name or full command
497 line.
498
499
500 __N__
501
502
503 sort tasks by pid (''n''umerically).
504
505
506 __A__
507
508
509 sort tasks by age (newest first).
510
511
512 __P__
513
514
515 sort tasks by CPU usage (default).
516
517
518 __M__
519
520
521 sort tasks by resident memory usage.
522
523
524 __T__
525
526
527 sort tasks by time / cumulative time.
528
529
530 __W__
531
532
533 Write current setup to ''~/.toprc''. This is the
534 recommended way to write a top configuration
535 file.
536 !!The Field and Order Screens
537
538
539 After pressing __f__, __F__, __o__ or __O__ you
540 will be shown a screen specifying the field order on the top
541 line and short descriptions of the field contents. The field
542 order string uses the following syntax: If the letter in the
543 filed string corresponding to a field is upper case, the
544 field will be displayed. This is furthermore indicated by an
545 asterisk in front of the field description. The order of the
546 fields corresponds to the order of the letters in the
547 string. From the field select screen you can toggle the
548 display of a field by pressing the corresponding letter.
549 From the order screen you may move a field to the left by
550 pressing the corresponding upper case letter resp. to the
551 right by pressing the lower case one.
552 !!Configuration Files
553
554
555 Top reads it's default configuration from two files,
556 ''/etc/toprc'' and ''~/.toprc''. The global
557 configuration file may be used to restrict the usage of top
558 to the secure mode for non-priviledged users. If this is
559 desired, the file should contain a 's' to specify secure
560 mode and a digit d (2
561 ''W''
562 interactive command. The second line is more interesting
563 (and important). It contains information on the other
564 options. Most important, if you have saved a configuration
565 in secure mode, you will not get an insecure top without
566 removing the lower 's' from the second line of your
567 ''~/.toprc''. A digit specifies the delay time between
568 updates, a capital 'S' cumulative mode, a lower 'i' no-idle
569 mode, a capital 'I' Irix view. As in interactive mode, a
570 lower 'm', 'l', and 't' suppresses the display of memory,
571 uptime resp. process and CPU state information. Currently
572 changing the default sorting order (by CPU usage) is not
573 supported.
574 !!NOTES
575
576
577 This __proc__-based __top__ works by reading the files
578 in the __proc__ filesystem, mounted on ''/proc''. If
579 ''/proc'' is not mounted, __top__ will not
580 work.
581
582
583 __%CPU__ shows the cputime/realtime percentage in the
584 period of time between updates. For the first update, a
585 short delay is used, and __top__ itself dominates the CPU
586 usage. After that, __top__ will drop back, and a more
587 reliable estimate of CPU usage is available.
588
589
590 The __SIZE__ and __RSS fields don't count the page
591 tables and the task_struct__ of a process; this is at
592 least 12K of memory that is always resident. __SIZE__ is
593 the virtual size of the process
594 (code+data+stack).
595
596
597 Keep in mind that a process must die for its time to be
598 recorded on its parent by cumulative mode. Perhaps more
599 useful behavior would be to follow each process upwards,
600 adding time, but that would be more expensive, possibly
601 prohibitively so. In any case, that would make __top__'s
602 behavior incompatible with __ps__.
603 !!FILES
604
605
606 ''/etc/toprc'' The global configuration file.
607 ''~/.toprc'' The personal configuration
608 file.
609 !!SEE ALSO
610
611
612 ps(1), free(1), uptime(1),
613 kill(1), renice(1).
614 !!BUGS
615
616
617 If the window is less than about 70x7, __top__ will not
618 format information correctly. Many fields still have
619 problems with ELF processes. the help screens are not yet
620 optimized for windows with less than 25 lines
621 !!AUTHOR
622
623
624 __top__ was originally written by Roger Binns, based on
625 Branko Lankester's
626 __
627
628
629 Helmut Geyer
630
631
632 The
633
634
635 Please send bug reports to
636 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.