1TOP(1)                        User Commands                        TOP(1)
2
3
4

NAME

6       top - display Linux processes
7
8

SYNOPSIS

10       top -hv|-bcHiOSs -d secs -n max -u|U user -p pid -o fld -w [cols]
11
12
13       The traditional switches `-' and whitespace are optional.
14
15

DESCRIPTION

17       The  top  program  provides  a dynamic real-time view of a running
18       system.  It can display system summary information as  well  as  a
19       list  of processes or threads currently being managed by the Linux
20       kernel.  The types of system summary  information  shown  and  the
21       types,  order  and size of information displayed for processes are
22       all user configurable and that configuration can be  made  persis‐
23       tent across restarts.
24
25       The  program  provides a limited interactive interface for process
26       manipulation as well as a much more extensive interface  for  per‐
27       sonal  configuration   --  encompassing every aspect of its opera‐
28       tion.  And while top is referred to throughout this document,  you
29       are  free  to  name the program anything you wish.  That new name,
30       possibly an alias, will then be reflected  on  top's  display  and
31       used when reading and writing a configuration file.
32
33

OVERVIEW

35   Documentation
36       The remaining Table of Contents
37
38           1. COMMAND-LINE Options
39           2. SUMMARY Display
40              a. UPTIME and LOAD Averages
41              b. TASK and CPU States
42              c. MEMORY Usage
43           3. FIELDS / Columns Display
44              a. DESCRIPTIONS of Fields
45              b. MANAGING Fields
46           4. INTERACTIVE Commands
47              a. GLOBAL Commands
48              b. SUMMARY AREA Commands
49              c. TASK AREA Commands
50                 1. Appearance
51                 2. Content
52                 3. Size
53                 4. Sorting
54              d. COLOR Mapping
55           5. ALTERNATE-DISPLAY Provisions
56              a. WINDOWS Overview
57              b. COMMANDS for Windows
58              c. SCROLLING a Window
59              d. SEARCHING in a Window
60              e. FILTERING in a Window
61           6. FILES
62              a. SYSTEM Configuration File
63              b. PERSONAL Configuration File
64              c. ADDING INSPECT Entries
65           7. STUPID TRICKS Sampler
66              a. Kernel Magic
67              b. Bouncing Windows
68              c. The Big Bird Window
69              d. The Ol' Switcheroo
70           8. BUGS, 9. HISTORY Former top, 10. AUTHOR, 11. SEE Also
71
72
73   Operation
74       When operating top, the two most important keys are the help (h or
75       ?)  key and quit ('q') key.  Alternatively, you could  simply  use
76       the traditional interrupt key (^C) when you're done.
77
78       When  started  for  the first time, you'll be presented with these
79       traditional elements on the main top screen: 1) Summary  Area;  2)
80       Fields/Columns  Header;  3)  Task  Area.   Each  of  these will be
81       explored in the sections that follow.  There is also an Input/Mes‐
82       sage  line between the Summary Area and Columns Header which needs
83       no further explanation.
84
85       The main top screen is generally quite adaptive to changes in ter‐
86       minal  dimensions  under X-Windows.  Other top screens may be less
87       so, especially those with static  text.   It  ultimately  depends,
88       however,  on your particular window manager and terminal emulator.
89       There may be occasions when their view of terminal size  and  cur‐
90       rent  contents  differs  from top's view, which is always based on
91       operating system calls.
92
93       Following any re-size operation, if a  top  screen  is  corrupted,
94       appears  incomplete or disordered, simply typing something innocu‐
95       ous like a punctuation character or cursor motion key will usually
96       restore  it.  In extreme cases, the following sequence almost cer‐
97       tainly will:
98              key/cmd  objective
99              ^Z       suspend top
100              fg       resume top
101              <Left>   force a screen redraw (if necessary)
102
103       But if the display is still corrupted, there is one more step  you
104       could  try.   Insert this command after top has been suspended but
105       before resuming it.
106              key/cmd  objective
107              reset    restore your terminal settings
108
109       Note: the width of top's display will be limited to 512 positions.
110       Displaying  all  fields  requires  approximately  250  characters.
111       Remaining screen width is usually allocated to any variable  width
112       columns  currently  visible.   The variable width columns, such as
113       COMMAND, are noted in topic 3a. DESCRIPTIONS  of  Fields.   Actual
114       output  width  may  also  be influenced by the -w switch, which is
115       discussed in topic 1. COMMAND-LINE Options.
116
117       Lastly, some of top's screens or functions require the use of cur‐
118       sor  motion  keys like the standard arrow keys plus the Home, End,
119       PgUp and PgDn keys.  If your terminal or emulator does not provide
120       those  keys,  the  following combinations are accepted as alterna‐
121       tives:
122              key      equivalent-key-combinations
123              Up       alt + \      or  alt + k
124              Down     alt + /      or  alt + j
125              Left     alt + <      or  alt + h
126              Right    alt + >      or  alt + l (lower case L)
127              PgUp     alt + Up     or  alt + ctrl + k
128              PgDn     alt + Down   or  alt + ctrl + j
129              Home     alt + Left   or  alt + ctrl + h
130              End      alt + Right  or  alt + ctrl + l
131
132       The Up and Down arrow keys have special significance when prompted
133       for  line  input  terminated with the <Enter> key.  Those keys, or
134       their aliases, can be used to retrieve previous input lines  which
135       can  then  be  edited and re-input.  And there are four additional
136       keys available with line oriented input.
137              key      special-significance
138              Up       recall older strings for re-editing
139              Down     recall newer strings or erase entire line
140              Insert   toggle between insert and overtype modes
141              Delete   character removed at cursor, moving others left
142              Home     jump to beginning of input line
143              End      jump to end of input line
144
145
146   Startup Defaults
147       The following startup defaults assume no configuration file,  thus
148       no  user  customizations.   Even  so, items shown with an asterisk
149       (`*') could be  overridden  through  the  command-line.   All  are
150       explained in detail in the sections that follow.
151
152           Global-defaults
153              A - Alt display      Off (full-screen)
154            * d - Delay time       1.5 seconds
155            * H - Threads mode     Off (summarize as tasks)
156              I - Irix mode        On  (no, `solaris' smp)
157            * p - PID monitoring   Off (show all processes)
158            * s - Secure mode      Off (unsecured)
159              B - Bold enable      On  (yes, bold globally)
160           Summary-Area-defaults
161              l - Load Avg/Uptime  On  (thus program name)
162              t - Task/Cpu states  On  (1+1 lines, see `1')
163              m - Mem/Swap usage   On  (2 lines worth)
164              1 - Single Cpu       Off (thus multiple cpus)
165           Task-Area-defaults
166              b - Bold hilite      Off (use `reverse')
167            * c - Command line     Off (name, not cmdline)
168            * i - Idle tasks       On  (show all tasks)
169              J - Num align right  On  (not left justify)
170              j - Str align right  Off (not right justify)
171              R - Reverse sort     On  (pids high-to-low)
172            * S - Cumulative time  Off (no, dead children)
173            * u - User filter      Off (show euid only)
174            * U - User filter      Off (show any uid)
175              V - Forest view      On  (show as branches)
176              x - Column hilite    Off (no, sort field)
177              y - Row hilite       On  (yes, running tasks)
178              z - color/mono       On  (show colors)
179
180

1. COMMAND-LINE Options

182       The command-line syntax for top consists of:
183
184         -hv|-bcHiOSs -d secs -n max -u|U user -p pid -o fld -w [cols]
185
186       The  typically mandatory switch ('-') and even whitespace are com‐
187       pletely optional.
188
189
190       -h | -v  :Help/Version
191            Show library version and the usage prompt, then quit.
192
193
194       -b  :Batch-mode operation
195            Starts top in Batch mode, which could be useful  for  sending
196            output  from  top  to  other  programs or to a file.  In this
197            mode, top will not accept input and runs until the iterations
198            limit  you've  set with the `-n' command-line option or until
199            killed.
200
201
202       -c  :Command-line/Program-name toggle
203            Starts top with  the  last  remembered  `c'  state  reversed.
204            Thus,  if  top  was  displaying command lines, now that field
205            will show program names, and visa versa.  See the `c'  inter‐
206            active command for additional information.
207
208
209       -d  :Delay-time interval as:  -d ss.t (secs.tenths)
210            Specifies the delay between screen updates, and overrides the
211            corresponding value in one's personal configuration  file  or
212            the  startup default.  Later this can be changed with the `d'
213            or `s' interactive commands.
214
215            Fractional seconds are honored, but a negative number is  not
216            allowed.   In all cases, however, such changes are prohibited
217            if top is running in Secure mode, except for root (unless the
218            `s'  command-line  option was used).  For additional informa‐
219            tion on Secure mode see topic 6a. SYSTEM Configuration File.
220
221
222       -H  :Threads-mode operation
223            Instructs top to display individual  threads.   Without  this
224            command-line  option  a  summation  of  all  threads  in each
225            process is shown.  Later this can be  changed  with  the  `H'
226            interactive command.
227
228
229       -i  :Idle-process toggle
230            Starts top with the last remembered `i' state reversed.  When
231            this toggle is Off, tasks that have not used  any  CPU  since
232            the last update will not be displayed.  For additional infor‐
233            mation regarding this toggle see topic  4c.  TASK  AREA  Com‐
234            mands, SIZE.
235
236
237       -n  :Number-of-iterations limit as:  -n number
238            Specifies  the  maximum  number of iterations, or frames, top
239            should produce before ending.
240
241
242       -o  :Override-sort-field as:  -o fieldname
243            Specifies the name of  the  field  on  which  tasks  will  be
244            sorted, independent of what is reflected in the configuration
245            file.  You can prepend a `+' or `-' to the field name to also
246            override  the sort direction.  A leading `+' will force sort‐
247            ing high to low, whereas a `-' will  ensure  a  low  to  high
248            ordering.
249
250            This  option  exists  primarily to support automated/scripted
251            batch mode operation.
252
253
254       -O  :Output-field-names
255            This option acts as a form of help for the above  -o  option.
256            It  will cause top to print each of the available field names
257            on a separate line, then quit.  Such names are subject to nls
258            translation.
259
260
261       -p  :Monitor-PIDs mode as:  -pN1 -pN2 ...  or  -pN1,N2,N3 ...
262            Monitor  only  processes  with  specified  process IDs.  This
263            option can be given up to 20 times,  or  you  can  provide  a
264            comma  delimited  list  with up to 20 pids.  Co-mingling both
265            approaches is permitted.
266
267            A pid value of zero will be treated as the process id of  the
268            top program itself once it is running.
269
270            This  is  a  command-line  option only and should you wish to
271            return to normal operation, it is not necessary to  quit  and
272            restart  top   --   just  issue any of these interactive com‐
273            mands: `=', `u' or `U'.
274
275            The `p', `u' and `U' command-line options are mutually exclu‐
276            sive.
277
278
279       -s  :Secure-mode operation
280            Starts top with secure mode forced, even for root.  This mode
281            is far better controlled  through  the  system  configuration
282            file (see topic 6. FILES).
283
284
285       -S  :Cumulative-time toggle
286            Starts top with the last remembered `S' state reversed.  When
287            Cumulative time mode is On, each process is listed  with  the
288            cpu  time  that  it and its dead children have used.  See the
289            `S' interactive command for additional information  regarding
290            this mode.
291
292
293       -u | -U  :User-filter-mode as:  -u | -U number or name
294            Display  only  processes with a user id or user name matching
295            that given.  The  `-u'  option  matches  on   effective  user
296            whereas the `-U' option matches on any user (real, effective,
297            saved, or filesystem).
298
299            Prepending an exclamation point ('!') to the user id or  name
300            instructs top to display only processes with users not match‐
301            ing the one provided.
302
303            The `p', `u' and `U' command-line options are mutually exclu‐
304            sive.
305
306
307       -w  :Output-width-override as:  -w [ number ]
308            In  Batch mode, when used without an argument top will format
309            output using the COLUMNS= and LINES=  environment  variables,
310            if  set.   Otherwise,  width will be fixed at the maximum 512
311            columns.  With an argument, output width can be decreased  or
312            increased  (up  to  512) but the number of rows is considered
313            unlimited.
314
315            In normal display mode, when used  without  an  argument  top
316            will  attempt  to format output using the COLUMNS= and LINES=
317            environment variables, if  set.   With  an  argument,  output
318            width  can  only  be decreased, not increased.  Whether using
319            environment variables or an argument with  -w,  when  not  in
320            Batch mode actual terminal dimensions can never be exceeded.
321
322            Note:  Without  the  use  of this command-line option, output
323            width is always based  on  the  terminal  at  which  top  was
324            invoked whether or not in Batch mode.
325
326

2. SUMMARY Display

328       Each  of  the  following  three  areas are individually controlled
329       through one or more interactive commands.  See topic  4b.  SUMMARY
330       AREA  Commands  for  additional information regarding these provi‐
331       sions.
332
333
334   2a. UPTIME and LOAD Averages
335       This portion consists of a single line containing:
336           program or window name, depending on display mode
337           current time and length of time since last boot
338           total number of users
339           system load avg over the last 1, 5 and 15 minutes
340
341
342   2b. TASK and CPU States
343       This portion consists of a minimum of two lines.  In an SMP  envi‐
344       ronment,  additional  lines  can reflect individual CPU state per‐
345       centages.
346
347       Line 1 shows total tasks or threads, depending on the state of the
348       Threads-mode toggle.  That total is further classified as:
349           running; sleeping; stopped; zombie
350
351       Line 2 shows CPU state percentages based on the interval since the
352       last refresh.
353
354       As a default, percentages for these individual categories are dis‐
355       played.   Where  two labels are shown below, those for more recent
356       kernel versions are shown first.
357           us, user    : time running un-niced user processes
358           sy, system  : time running kernel processes
359           ni, nice    : time running niced user processes
360           id, idle    : time spent in the kernel idle handler
361           wa, IO-wait : time waiting for I/O completion
362           hi : time spent servicing hardware interrupts
363           si : time spent servicing software interrupts
364           st : time stolen from this vm by the hypervisor
365
366       In the alternate  cpu  states  display  modes,  beyond  the  first
367       tasks/threads  line, an abbreviated summary is shown consisting of
368       these elements:
369                      a    b     c    d
370           %Cpu(s):  75.0/25.0  100[ ...
371
372
373       Where: a) is the combined us and ni percentage; b) is the sy  per‐
374       centage;  c)  is  the total; and d) is one of two visual graphs of
375       those representations.  See topic 4b. SUMMARY  AREA  Commands  and
376       the  `t'  command for additional information on that special 4-way
377       toggle.
378
379
380   2c. MEMORY Usage
381       This portion consists of two lines which  may  express  values  in
382       kibibytes  (KiB)  through exbibytes (EiB) depending on the scaling
383       factor enforced with the `E' interactive command.
384
385       As a default, Line 1 reflects physical memory, classified as:
386           total, free, used and buff/cache
387
388       Line 2 reflects mostly virtual memory, classified as:
389           total, free, used and avail (which is physical memory)
390
391       The avail number on line 2 is an  estimation  of  physical  memory
392       available for starting new applications, without swapping.  Unlike
393       the free field, it attempts to  account  for  readily  reclaimable
394       page  cache  and  memory  slabs.  It is available on kernels 3.14,
395       emulated on kernels 2.6.27+, otherwise the same as free.
396
397       In the alternate memory display  modes,  two  abbreviated  summary
398       lines are shown consisting of these elements:
399                      a    b          c
400           GiB Mem : 18.7/15.738   [ ...
401           GiB Swap:  0.0/7.999    [ ...
402
403       Where:  a)  is the percentage used; b) is the total available; and
404       c) is one of two visual graphs of those representations.
405
406       In the case of physical  memory,  the  percentage  represents  the
407       total  minus  the  estimated  avail  noted above.  The `Mem' graph
408       itself is divided between used and any remaining memory not other‐
409       wise  accounted for by avail.  See topic 4b. SUMMARY AREA Commands
410       and the `m' command for additional  information  on  that  special
411       4-way toggle.
412
413       This table may help in interpreting the scaled values displayed:
414           KiB = kibibyte = 1024 bytes
415           MiB = mebibyte = 1024 KiB = 1,048,576 bytes
416           GiB = gibibyte = 1024 MiB = 1,073,741,824 bytes
417           TiB = tebibyte = 1024 GiB = 1,099,511,627,776 bytes
418           PiB = pebibyte = 1024 TiB = 1,125,899,906,842,624 bytes
419           EiB = exbibyte = 1024 PiB = 1,152,921,504,606,846,976 bytes
420
421

3. FIELDS / Columns

423   3a. DESCRIPTIONS of Fields
424       Listed  below  are top's available process fields (columns).  They
425       are shown in strict ascii alphabetical order.  You  may  customize
426       their  position  and  whether or not they are displayable with the
427       `f' or `F' (Fields Management) interactive commands.
428
429       Any field is selectable as the sort field, and you control whether
430       they are sorted high-to-low or low-to-high.  For additional infor‐
431       mation on sort provisions see topic 4c. TASK AREA Commands,  SORT‐
432       ING.
433
434       The  fields related to physical memory or virtual memory reference
435       `(KiB)' which is the unsuffixed display mode.   Such  fields  may,
436       however,  be  scaled from KiB through PiB.  That scaling is influ‐
437       enced via the `e' interactive command or established  for  startup
438       through a build option.
439
440
441        1. %CPU  --  CPU Usage
442           The task's share of the elapsed CPU time since the last screen
443           update, expressed as a percentage of total CPU time.
444
445           In a true SMP environment, if a process is multi-threaded  and
446           top  is  not  operating  in Threads mode, amounts greater than
447           100% may be reported.  You toggle Threads mode  with  the  `H'
448           interactive command.
449
450           Also  for  multi-processor  environments, if Irix mode is Off,
451           top will operate in Solaris mode where a task's cpu usage will
452           be   divided   by  the  total  number  of  CPUs.   You  toggle
453           Irix/Solaris modes with the `I' interactive command.
454
455
456        2. %MEM  --  Memory Usage (RES)
457           A task's currently used share of available physical memory.
458
459
460        3. CGROUPS  --  Control Groups
461           The names of the control group(s) to which a process  belongs,
462           or `-' if not applicable for that process.
463
464           Control  Groups provide for allocating resources (cpu, memory,
465           network bandwidth, etc.) among installation-defined groups  of
466           processes.   They enable fine-grained control over allocating,
467           denying,   prioritizing,   managing   and   monitoring   those
468           resources.
469
470           Many different hierarchies of cgroups can exist simultaneously
471           on a system and each hierarchy is attached to one or more sub‐
472           systems.  A subsystem represents a single resource.
473
474           Note:  The  CGROUPS  field, unlike most columns, is not fixed-
475           width.  When displayed, it plus any other variable width  col‐
476           umns  will  be allocated all remaining screen width (up to the
477           maximum 512 characters).  Even so, such variable width  fields
478           could still suffer truncation.  See topic 5c. SCROLLING a Win‐
479           dow for additional  information  on  accessing  any  truncated
480           data.
481
482
483        4. CODE  --  Code Size (KiB)
484           The amount of physical memory devoted to executable code, also
485           known as the Text Resident Set size or TRS.
486
487
488        5. COMMAND  --  Command Name or Command Line
489           Display the command line used to start a task or the  name  of
490           the  associated  program.  You toggle between command line and
491           name with `c', which is both  a  command-line  option  and  an
492           interactive command.
493
494           When you've chosen to display command lines, processes without
495           a command line (like kernel threads) will be shown  with  only
496           the program name in brackets, as in this example:
497               [kthreadd]
498
499           This  field  may  also  be impacted by the forest view display
500           mode.  See the `V' interactive command for additional informa‐
501           tion regarding that mode.
502
503           Note:  The  COMMAND  field, unlike most columns, is not fixed-
504           width.  When displayed, it plus any other variable width  col‐
505           umns  will  be allocated all remaining screen width (up to the
506           maximum 512 characters).  Even so, such variable width  fields
507           could  still  suffer  truncation.  This is especially true for
508           this field when command lines are  being  displayed  (the  `c'
509           interactive  command.)   See  topic 5c. SCROLLING a Window for
510           additional information on accessing any truncated data.
511
512
513        6. DATA  --  Data + Stack Size (KiB)
514           The amount of physical memory devoted to other than executable
515           code, also known as the Data Resident Set size or DRS.
516
517
518        7. ENVIRON  --  Environment variables
519           Display  all  of the environment variables, if any, as seen by
520           the respective processes.  These variables will  be  displayed
521           in their raw native order, not the sorted order you are accus‐
522           tomed to seeing with an unqualified `set'.
523
524           Note: The ENVIRON field, unlike most columns,  is  not  fixed-
525           width.   When displayed, it plus any other variable width col‐
526           umns will be allocated all remaining screen width (up  to  the
527           maximum  512 characters).  Even so, such variable width fields
528           could still suffer truncation.  This is  especially  true  for
529           this  field.   See topic 5c. SCROLLING a Window for additional
530           information on accessing any truncated data.
531
532
533        8. Flags  --  Task Flags
534           This column represents the  task's  current  scheduling  flags
535           which  are  expressed  in  hexadecimal notation and with zeros
536           suppressed.   These  flags  are   officially   documented   in
537           <linux/sched.h>.
538
539
540        9. GID  --  Group Id
541           The effective group ID.
542
543
544       10. GROUP  --  Group Name
545           The effective group name.
546
547
548       11. NI  --  Nice Value
549           The  nice  value  of  the  task.   A negative nice value means
550           higher priority, whereas a positive  nice  value  means  lower
551           priority.   Zero  in this field simply means priority will not
552           be adjusted in determining a task's dispatch-ability.
553
554
555       12. P  --  Last used CPU (SMP)
556           A number representing the last used processor.  In a true  SMP
557           environment  this will likely change frequently since the ker‐
558           nel intentionally uses weak affinity.  Also, the very  act  of
559           running  top  may break this weak affinity and cause more pro‐
560           cesses to change CPUs more often (because of the extra  demand
561           for cpu time).
562
563
564       13. PGRP  --  Process Group Id
565           Every  process  is  member  of a unique process group which is
566           used for distribution of signals and by terminals to arbitrate
567           requests  for  their input and output.  When a process is cre‐
568           ated (forked), it becomes a member of the process group of its
569           parent.   By convention, this value equals the process ID (see
570           PID) of the first  member  of  a  process  group,  called  the
571           process group leader.
572
573
574       14. PID  --  Process Id
575           The task's unique process ID, which periodically wraps, though
576           never restarting at zero.  In kernel terms, it is a  dispatch‐
577           able entity defined by a task_struct.
578
579           This value may also be used as: a process group ID (see PGRP);
580           a session ID for the session leader (see SID); a thread  group
581           ID  for  the thread group leader (see TGID); and a TTY process
582           group ID for the process group leader (see TPGID).
583
584
585       15. PPID  --  Parent Process Id
586           The process ID (pid) of a task's parent.
587
588
589       16. PR  --  Priority
590           The scheduling priority of the task.  If you see `rt' in  this
591           field, it means the task is running under real time scheduling
592           priority.
593
594           Under linux, real time priority is somewhat  misleading  since
595           traditionally  the  operating itself was not preemptible.  And
596           while the 2.6 kernel can be made mostly preemptible, it is not
597           always so.
598
599
600       17. RES  --  Resident Memory Size (KiB)
601           The non-swapped physical memory a task is using.
602
603
604       18. RUID  --  Real User Id
605           The real user ID.
606
607
608       19. RUSER  --  Real User Name
609           The real user name.
610
611
612       20. S  --  Process Status
613           The status of the task which can be one of:
614               D = uninterruptible sleep
615               R = running
616               S = sleeping
617               T = stopped by job control signal
618               t = stopped by debugger during trace
619               Z = zombie
620
621           Tasks  shown  as running should be more properly thought of as
622           ready to run  --  their task_struct is simply  represented  on
623           the Linux run-queue.  Even without a true SMP machine, you may
624           see numerous tasks in this  state  depending  on  top's  delay
625           interval and nice value.
626
627
628       21. SHR  --  Shared Memory Size (KiB)
629           The  amount  of  shared memory available to a task, not all of
630           which is typically resident.  It simply reflects  memory  that
631           could be potentially shared with other processes.
632
633
634       22. SID  --  Session Id
635           A  session  is a collection of process groups (see PGRP), usu‐
636           ally established by the login shell.  A newly  forked  process
637           joins  the  session of its creator.  By convention, this value
638           equals the process ID (see PID) of the  first  member  of  the
639           session, called the session leader, which is usually the login
640           shell.
641
642
643       23. SUID  --  Saved User Id
644           The saved user ID.
645
646
647       24. SUPGIDS  --  Supplementary Group IDs
648           The IDs of any supplementary group(s) established at login  or
649           inherited from a task's parent.  They are displayed in a comma
650           delimited list.
651
652           Note: The SUPGIDS field, unlike most columns,  is  not  fixed-
653           width.   When displayed, it plus any other variable width col‐
654           umns will be allocated all remaining screen width (up  to  the
655           maximum  512 characters).  Even so, such variable width fields
656           could still suffer truncation.  See topic 5c. SCROLLING a Win‐
657           dow  for  additional  information  on  accessing any truncated
658           data.
659
660
661       25. SUPGRPS  --  Supplementary Group Names
662           The names of any supplementary group(s) established  at  login
663           or  inherited  from  a task's parent.  They are displayed in a
664           comma delimited list.
665
666           Note: The SUPGRPS field, unlike most columns,  is  not  fixed-
667           width.   When displayed, it plus any other variable width col‐
668           umns will be allocated all remaining screen width (up  to  the
669           maximum  512 characters).  Even so, such variable width fields
670           could still suffer truncation.  See topic 5c. SCROLLING a Win‐
671           dow  for  additional  information  on  accessing any truncated
672           data.
673
674
675       26. SUSER  --  Saved User Name
676           The saved user name.
677
678
679       27. SWAP  --  Swapped Size (KiB)
680           The non-resident portion of a task's address space.
681
682
683       28. TGID  --  Thread Group Id
684           The ID of the thread group to which a task belongs.  It is the
685           PID  of  the  thread group leader.  In kernel terms, it repre‐
686           sents those tasks that share an mm_struct.
687
688
689       29. TIME  --  CPU Time
690           Total CPU time the task has used since it started.  When Cumu‐
691           lative  mode  is  On, each process is listed with the cpu time
692           that it and its dead children have used.  You  toggle  Cumula‐
693           tive mode with `S', which is both a command-line option and an
694           interactive command.  See  the  `S'  interactive  command  for
695           additional information regarding this mode.
696
697
698       30. TIME+  --  CPU Time, hundredths
699           The same as TIME, but reflecting more granularity through hun‐
700           dredths of a second.
701
702
703       31. TPGID  --  Tty Process Group Id
704           The process group ID of the foreground process  for  the  con‐
705           nected tty, or -1 if a process is not connected to a terminal.
706           By convention, this value equals the process ID (see  PID)  of
707           the process group leader (see PGRP).
708
709
710       32. TTY  --  Controlling Tty
711           The  name  of  the  controlling terminal.  This is usually the
712           device (serial port, pty, etc.) from  which  the  process  was
713           started,  and  which  it uses for input or output.  However, a
714           task need not be associated with a  terminal,  in  which  case
715           you'll see `?' displayed.
716
717
718       33. UID  --  User Id
719           The effective user ID of the task's owner.
720
721
722       34. USED  --  Memory in Use (KiB)
723           This  field  represents the non-swapped physical memory a task
724           has used (RES) plus the non-resident portion  of  its  address
725           space (SWAP).
726
727
728       35. USER  --  User Name
729           The effective user name of the task's owner.
730
731
732       36. VIRT  --  Virtual Memory Size (KiB)
733           The  total  amount  of  virtual  memory  used by the task.  It
734           includes all code, data and shared libraries plus  pages  that
735           have  been swapped out and pages that have been mapped but not
736           used.
737
738
739       37. WCHAN  --  Sleeping in Function
740           Depending on the availability of the  kernel  link  map  (Sys‐
741           tem.map),  this field will show the name or the address of the
742           kernel function in which the task is currently sleeping.  Run‐
743           ning tasks will display a dash ('-') in this column.
744
745           By  displaying  this  field,  top's  own  working set could be
746           increased by over 700Kb,  depending  on  the  kernel  version.
747           Should  that  occur, your only means of reducing that overhead
748           will be to stop and restart top.
749
750
751       38. nDRT  --  Dirty Pages Count
752           The number of pages that have been modified  since  they  were
753           last  written to auxiliary storage.  Dirty pages must be writ‐
754           ten to auxiliary storage  before  the  corresponding  physical
755           memory location can be used for some other virtual page.
756
757
758       39. nMaj  --  Major Page Fault Count
759           The number of major page faults that have occurred for a task.
760           A page fault occurs when a process attempts to  read  from  or
761           write  to  a virtual page that is not currently present in its
762           address space.  A major page fault is when  auxiliary  storage
763           access is involved in making that page available.
764
765
766       40. nMin  --  Minor Page Fault count
767           The number of minor page faults that have occurred for a task.
768           A page fault occurs when a process attempts to  read  from  or
769           write  to  a virtual page that is not currently present in its
770           address space.  A minor page fault does not involve  auxiliary
771           storage access in making that page available.
772
773
774       41. nTH  --  Number of Threads
775           The number of threads associated with a process.
776
777
778       42. nsIPC  --  IPC namespace
779           The Inode of the namespace used to isolate interprocess commu‐
780           nication (IPC) resources such as  System  V  IPC  objects  and
781           POSIX message queues.
782
783
784       43. nsMNT  --  MNT namespace
785           The  Inode  of  the namespace used to isolate filesystem mount
786           points thus offering different views of the filesystem hierar‐
787           chy.
788
789
790       44. nsNET  --  NET namespace
791           The  Inode  of the namespace used to isolate resources such as
792           network devices, IP addresses, IP routing, port numbers, etc.
793
794
795       45. nsPID  --  PID namespace
796           The Inode of the namespace used to isolate process ID  numbers
797           meaning  they  need not remain unique.  Thus, each such names‐
798           pace could have its own `init' (PID #1) to manage various ini‐
799           tialization tasks and reap orphaned child processes.
800
801
802       46. nsUSER  --  USER namespace
803           The  Inode of the namespace used to isolate the user and group
804           ID numbers.  Thus, a process could have a normal  unprivileged
805           user  ID outside a user namespace while having a user ID of 0,
806           with full root privileges, inside that namespace.
807
808
809       47. nsUTS  --  UTS namespace
810           The Inode of the namespace used to isolate  hostname  and  NIS
811           domain name.  UTS simply means "UNIX Time-sharing System".
812
813
814       48. vMj  --  Major Page Fault Count Delta
815           The  number  of major page faults that have occurred since the
816           last update (see nMaj).
817
818
819       49. vMn  --  Minor Page Fault Count Delta
820           The number of minor page faults that have occurred  since  the
821           last update (see nMin).
822
823
824
825   3b. MANAGING Fields
826       After  pressing the interactive command `f' or `F' (Fields Manage‐
827       ment) you will be presented with a screen showing:  1)  the  `cur‐
828       rent'  window name; 2) the designated sort field; 3) all fields in
829       their current order along with descriptions.  Entries marked  with
830       an  asterisk are the currently displayed fields, screen width per‐
831       mitting.
832
833
834           ·  As the on screen instructions indicate, you navigate  among
835              the  fields  with  the  Up  and Down arrow keys.  The PgUp,
836              PgDn, Home and End keys can also be used to  quickly  reach
837              the first or last available field.
838
839
840           ·  The  Right  arrow key selects a field for repositioning and
841              the Left arrow key or the <Enter> key commits that  field's
842              placement.
843
844
845           ·  The  `d'  key  or the <Space> bar toggles a field's display
846              status, and thus the presence or absence of the asterisk.
847
848
849           ·  The `s' key designates a field  as  the  sort  field.   See
850              topic 4c. TASK AREA Commands, SORTING for additional infor‐
851              mation regarding your selection of a sort field.
852
853
854           ·  The `a' and `w' keys can  be  used  to  cycle  through  all
855              available  windows  and  the  `q' or <Esc> keys exit Fields
856              Management.
857
858
859       The Fields Management screen can also be used to change the  `cur‐
860       rent'  window/field  group  in  either  full-screen mode or alter‐
861       nate-display mode.  Whatever was targeted when `q'  or  <Esc>  was
862       pressed  will  be  made  current as you return to the top display.
863       See topic 5. ALTERNATE-DISPLAY Provisions and the `g'  interactive
864       command for insight into `current' windows and field groups.
865
866
867       Note: Any window that has been scrolled horizontally will be reset
868       if any field changes are made via the  Fields  Management  screen.
869       Any  vertical  scrolled  position,  however, will not be affected.
870       See topic  5c.  SCROLLING  a  Window  for  additional  information
871       regarding vertical and horizontal scrolling.
872
873

4. INTERACTIVE Commands

875       Listed below is a brief index of commands within categories.  Some
876       commands appear more than once  --  their  meaning  or  scope  may
877       vary depending on the context in which they are issued.
878
879         4a. Global-Commands
880               <Ent/Sp> ?, =, 0,
881               A, B, d, E, e, g, h, H, I, k, q, r, s, W, X, Y, Z
882         4b. Summary-Area-Commands
883               C, l, t, m, 1, 2, 3
884         4c. Task-Area-Commands
885               Appearance:  b, J, j, x, y, z
886               Content:     c, f, F, o, O, S, u, U, V
887               Size:        #, i, n
888               Sorting:     <, >, f, F, R
889         4d. Color-Mapping
890               <Ret>, a, B, b, H, M, q, S, T, w, z, 0 - 7
891         5b. Commands-for-Windows
892               -, _, =, +, A, a, g, G, w
893         5c. Scrolling-a-Window
894               C, Up, Dn, Left, Right, PgUp, PgDn, Home, End
895         5d. Searching-in-a-Window
896               L, &
897
898
899   4a. GLOBAL Commands
900       The  global  interactive  commands  are  always  available in both
901       full-screen mode and alternate-display  mode.   However,  some  of
902       these  interactive  commands  are  not  available  when running in
903       Secure mode.
904
905       If you wish to know in advance whether or not your  top  has  been
906       secured,  simply  ask  for help and view the system summary on the
907       second line.
908
909
910         <Enter> or <Space>  :Refresh-Display
911              These commands awaken top  and  following  receipt  of  any
912              input  the  entire  display  will  be repainted.  They also
913              force an update of any hotplugged cpu  or  physical  memory
914              changes.
915
916              Use either of these keys if you have a large delay interval
917              and wish to see current status,
918
919
920          ? | h  :Help
921              There are two help levels available.  The first  will  pro‐
922              vide  a reminder of all the basic interactive commands.  If
923              top is secured, that screen will be abbreviated.
924
925              Typing `h' or `?' on that help screen will take you to help
926              for those interactive commands applicable to alternate-dis‐
927              play mode.
928
929
930          =  :Exit-Task-Limits
931              Removes restrictions on which tasks are shown.   This  com‐
932              mand  will reverse any `i' (idle tasks) and `n' (max tasks)
933              commands that might be active.  It  also  provides  for  an
934              exit  from PID monitoring, User filtering and Other filter‐
935              ing.  See the `-p' command-line option for a discussion  of
936              PID  monitoring,  the  `U'  or `u' interactive commands for
937              User filtering and the `O' or `o' interactive commands  for
938              Other filtering.
939
940              Additionally,  any  window  that  has been scrolled will be
941              reset with this command.  See topic 5c. SCROLLING a  Window
942              for  additional information regarding vertical and horizon‐
943              tal scrolling.
944
945              When operating in alternate-display mode this command has a
946              broader meaning.
947
948
949          0  :Zero-Suppress toggle
950              This  command  determines  whether  zeros are shown or sup‐
951              pressed for many of the fields in a  task  window.   Fields
952              like UID, GID, NI, PR or P are not affected by this toggle.
953
954
955          A  :Alternate-Display-Mode toggle
956              This  command  will  switch  between  full-screen  mode and
957              alternate-display mode.   See  topic  5.  ALTERNATE-DISPLAY
958              Provisions and the `g' interactive command for insight into
959              `current' windows and field groups.
960
961
962          B  :Bold-Disable/Enable toggle
963              This command will influence use of the bold terminfo  capa‐
964              bility  and  alters both the summary area and task area for
965              the `current' window.  While it is intended  primarily  for
966              use with dumb terminals, it can be applied anytime.
967
968              Note:  When this toggle is On and top is operating in mono‐
969              chrome mode, the entire display will appear as normal text.
970              Thus,  unless  the `x' and/or `y' toggles are using reverse
971              for emphasis, there will be  no  visual  confirmation  that
972              they are even on.
973
974
975       *  d | s  :Change-Delay-Time-interval
976              You  will  be prompted to enter the delay time, in seconds,
977              between display updates.
978
979              Fractional seconds are honored, but a  negative  number  is
980              not   allowed.    Entering  0  causes  (nearly)  continuous
981              updates, with an unsatisfactory display as the  system  and
982              tty  driver  try  to keep up with top's demands.  The delay
983              value is inversely proportional to system loading,  so  set
984              it with care.
985
986              If  at  any  time  you wish to know the current delay time,
987              simply ask for help and view the system summary on the sec‐
988              ond line.
989
990
991          E  :Extend-Memory-Scale in Summary Area
992              With  this command you can cycle through the available sum‐
993              mary area memory scaling which ranges from  KiB  (kibibytes
994              or    1,024    bytes)    through    EiB    (exbibytes    or
995              1,152,921,504,606,846,976 bytes).
996
997              If you see a `+' between a displayed number and the follow‐
998              ing  label,  it  means that top was forced to truncate some
999              portion of that number.  By  raising  the  scaling  factor,
1000              such truncation can be avoided.
1001
1002
1003          e  :Extend-Memory-Scale in Task Windows
1004              With  this command you can cycle through the available task
1005              window memory scaling which ranges from KiB  (kibibytes  or
1006              1,024      bytes)     through     PiB     (pebibytes     or
1007              1,125,899,906,842,624 bytes).
1008
1009              While top will try to  honor  the  selected  target  range,
1010              additional  scaling  might  still  be necessary in order to
1011              accommodate current values.  If you  wish  to  see  a  more
1012              homogeneous result in the memory columns, raising the scal‐
1013              ing range will usually accomplish that  goal.   Raising  it
1014              too  high, however, is likely to produce an all zero result
1015              which cannot be suppressed with the  `0'  interactive  com‐
1016              mand.
1017
1018
1019          g  :Choose-Another-Window/Field-Group
1020              You will be prompted to enter a number between 1 and 4 des‐
1021              ignating the field group which should be made the `current'
1022              window.   You  will soon grow comfortable with these 4 win‐
1023              dows, especially after experimenting with alternate-display
1024              mode.
1025
1026
1027          H  :Threads-mode toggle
1028              When  this  toggle  is  On, individual threads will be dis‐
1029              played for all processes in all visible task windows.  Oth‐
1030              erwise,  top  displays  a  summation of all threads in each
1031              process.
1032
1033
1034          I  :Irix/Solaris-Mode toggle
1035              When operating in Solaris mode (`I' toggled Off), a  task's
1036              cpu  usage  will  be  divided  by the total number of CPUs.
1037              After issuing this command, you'll be told the new state of
1038              this toggle.
1039
1040
1041       *  k  :Kill-a-task
1042              You will be prompted for a PID and then the signal to send.
1043
1044              Entering no PID or a negative number will be interpreted as
1045              the default shown in the prompt (the first task displayed).
1046              A PID value of zero means the top program itself.
1047
1048              The default signal, as reflected in the prompt, is SIGTERM.
1049              However, you can send any signal, via number or name.
1050
1051              If you wish to abort the kill process, do one of  the  fol‐
1052              lowing depending on your progress:
1053                  1) at the pid prompt, type an invalid number
1054                  2) at the signal prompt, type 0 (or any invalid signal)
1055                  3) at any prompt, type <Esc>
1056
1057
1058          q  :Quit
1059
1060
1061       *  r  :Renice-a-Task
1062              You  will  be prompted for a PID and then the value to nice
1063              it to.
1064
1065              Entering no PID or a negative number will be interpreted as
1066              the default shown in the prompt (the first task displayed).
1067              A PID value of zero means the top program itself.
1068
1069              A positive nice value will cause a process to  lose  prior‐
1070              ity.   Conversely,  a  negative  nice  value  will  cause a
1071              process to be viewed more favorably by the  kernel.   As  a
1072              general  rule,  ordinary  users  can only increase the nice
1073              value and are prevented from lowering it.
1074
1075              If you wish to abort the renice process, do one of the fol‐
1076              lowing depending on your progress:
1077                  1) at the pid prompt, type an invalid number
1078                  2) at the nice prompt, type <Enter> with no input
1079                  3) at any prompt, type <Esc>
1080
1081
1082          W  :Write-the-Configuration-File
1083              This  will  save  all  of your options and toggles plus the
1084              current display mode and delay time.  By issuing this  com‐
1085              mand  just  before  quitting  top, you will be able restart
1086              later in exactly that same state.
1087
1088
1089          X  :Extra-Fixed-Width
1090              Some fields are fixed width and  not  scalable.   As  such,
1091              they  are subject to truncation which would be indicated by
1092              a `+' in the last position.
1093
1094              This interactive command can be used to alter the widths of
1095              the following fields:
1096
1097                  field  default    field  default    field  default
1098                  GID       5       GROUP     8       WCHAN    10
1099                  RUID      5       RUSER     8       nsIPC    10
1100                  SUID      5       SUSER     8       nsMNT    10
1101                  UID       5       USER      8       nsNET    10
1102                                    TTY       8       nsPID    10
1103                                                      nsUSER   10
1104                                                      nsUTS    10
1105
1106              You  will  be  prompted  for  the amount to be added to the
1107              default widths shown above.  Entering zero forces a  return
1108              to those defaults.
1109
1110              If  you  enter  a  negative  number, top will automatically
1111              increase the column size as needed until there is  no  more
1112              truncated  data.  You can accelerate this process by reduc‐
1113              ing the delay interval or holding down the <Space> bar.
1114
1115              Note: Whether explicitly or  automatically  increased,  the
1116              widths  for  these  fields  are never decreased by top.  To
1117              narrow them you must specify a smaller  number  or  restore
1118              the defaults.
1119
1120
1121          Y  :Inspect-Other-Output
1122              After  issuing  the  `Y'  interactive  command, you will be
1123              prompted for a target PID.  Typing a value or accepting the
1124              default  results  in a separate screen.  That screen can be
1125              used to view a variety of files  or  piped  command  output
1126              while the normal top iterative display is paused.
1127
1128              Note:  This interactive command is only fully realized when
1129              supporting entries have been manually added to the  end  of
1130              the  top configuration file.  For details on creating those
1131              entries, see topic 6c. ADDING INSPECT Entries.
1132
1133              Most of the keys used to navigate the Inspect  feature  are
1134              reflected  in  its  header  prologue.   There are, however,
1135              additional keys available once you have selected a particu‐
1136              lar  file  or command.  They are familiar to anyone who has
1137              used the pager `less' and are summarized  here  for  future
1138              reference.
1139
1140                  key      function
1141                  =        alternate status-line, file or pipeline
1142                  /        find, equivalent to `L' locate
1143                  n        find next, equivalent to `&' locate next
1144                  <Space>  scroll down, equivalent to <PgDn>
1145                  b        scroll up, equivalent to <PgUp>
1146                  g        first line, equivalent to <Home>
1147                  G        last line, equivalent to <End>
1148
1149
1150          Z  :Change-Color-Mapping
1151              This  key  will take you to a separate screen where you can
1152              change the colors for the `current' window, or for all win‐
1153              dows.   For  details regarding this interactive command see
1154              topic 4d. COLOR Mapping.
1155
1156
1157       *  The commands shown with an asterisk (`*') are not available  in
1158          Secure mode, nor will they be shown on the level-1 help screen.
1159
1160
1161   4b. SUMMARY AREA Commands
1162       The summary area interactive commands are always available in both
1163       full-screen mode and  alternate-display  mode.   They  affect  the
1164       beginning lines of your display and will determine the position of
1165       messages and prompts.
1166
1167       These commands  always  impact  just  the  `current'  window/field
1168       group.   See  topic  5.  ALTERNATE-DISPLAY  Provisions and the `g'
1169       interactive command for insight into `current' windows  and  field
1170       groups.
1171
1172
1173          C  :Show-scroll-coordinates toggle
1174              Toggle an informational message which is displayed whenever
1175              the message line is not otherwise being  used.   For  addi‐
1176              tional information see topic 5c. SCROLLING a Window.
1177
1178
1179          l  :Load-Average/Uptime toggle
1180              This is also the line containing the program name (possibly
1181              an alias) when operating in full-screen mode or  the  `cur‐
1182              rent' window name when operating in alternate-display mode.
1183
1184
1185          t  :Task/Cpu-States toggle
1186              This  command  affects  from  2 to many summary area lines,
1187              depending on the state of the `1', `2' or `3' command  tog‐
1188              gles and whether or not top is running under true SMP.
1189
1190              This  portion of the summary area is also influenced by the
1191              `H' interactive command toggle, as reflected in  the  total
1192              label which shows either Tasks or Threads.
1193
1194              This  command  serves  as  a  4-way toggle, cycling through
1195              these modes:
1196                  1. detailed percentages by category (default)
1197                  2. abbreviated user/system and total % + bar graph
1198                  3. abbreviated user/system and total % + block graph
1199                  4. turn off task and cpu states display
1200
1201              When operating in either of the graphic modes, the  display
1202              becomes  much  more meaningful when individual CPUs or NUMA
1203              nodes are also displayed.  See the the  `1',  `2'  and  `3'
1204              commands below for additional information.
1205
1206
1207          m  :Memory/Swap-Usage toggle
1208              This  command  affects  the  two summary area lines dealing
1209              with physical and virtual memory.
1210
1211              This command serves as  a  4-way  toggle,  cycling  through
1212              these modes:
1213                  1. detailed percentages by memory type (default)
1214                  2. abbreviated % used/total available + bar graph
1215                  3. abbreviated % used/total available + block graph
1216                  4. turn off memory display
1217
1218
1219          1  :Single/Separate-Cpu-States toggle
1220              This  command affects how the `t' command's Cpu States por‐
1221              tion is shown.  Although this toggle  exists  primarily  to
1222              serve massively-parallel SMP machines, it is not restricted
1223              to solely SMP environments.
1224
1225              When you see `%Cpu(s):' in the summary area, the `1' toggle
1226              is On and all cpu information is gathered in a single line.
1227              Otherwise, each cpu is  displayed  separately  as:  `%Cpu0,
1228              %Cpu1, ...'  up to available screen height.
1229
1230
1231          2  :NUMA-Nodes/Cpu-Summary toggle
1232              This  command  toggles  between the `1' command cpu summary
1233              display (only) or a summary display plus the cpu usage sta‐
1234              tistics for each NUMA Node.  It is only available if a sys‐
1235              tem has the requisite NUMA support.
1236
1237
1238          3  :Expand-NUMA-Node
1239              You will be invited to enter a number representing  a  NUMA
1240              Node.   Thereafter,  a node summary plus the statistics for
1241              each cpu in that node will be shown until either the `1' or
1242              `2' command toggle is pressed.  This interactive command is
1243              only available if a system has the requisite NUMA support.
1244
1245
1246       Note: If the entire summary area has been toggled Off for any win‐
1247       dow,  you  would be left with just the message line.  In that way,
1248       you will have maximized available task rows but (temporarily) sac‐
1249       rificed the program name in full-screen mode or the `current' win‐
1250       dow name when in alternate-display mode.
1251
1252
1253   4c. TASK AREA Commands
1254       The  task  area  interactive  commands  are  always  available  in
1255       full-screen mode.
1256
1257       The  task  area interactive commands are never available in alter‐
1258       nate-display mode if the `current' window's task display has  been
1259       toggled Off (see topic 5. ALTERNATE-DISPLAY Provisions).
1260
1261
1262       APPEARANCE of task window
1263
1264
1265          J  :Justify-Numeric-Columns toggle
1266              Alternates  between right-justified (the default) and left-
1267              justified numeric data.  If  the  numeric  data  completely
1268              fills  the available column, this command toggle may impact
1269              the column header only.
1270
1271
1272          j  :Justify-Character-Columns toggle
1273              Alternates between left-justified (the default) and  right-
1274              justified character data.  If the character data completely
1275              fills the available column, this command toggle may  impact
1276              the column header only.
1277
1278
1279         The  following  commands will also be influenced by the state of
1280         the global `B' (bold enable) toggle.
1281
1282
1283          b  :Bold/Reverse toggle
1284              This command will impact how the `x' and  `y'  toggles  are
1285              displayed.   It may also impact the summary area when a bar
1286              graph has been selected for cpu states or memory usage  via
1287              the 't' or 'm' toggles.
1288
1289
1290          x  :Column-Highlight toggle
1291              Changes  highlighting  for  the current sort field.  If you
1292              forget which field is being sorted this command  can  serve
1293              as  a  quick  visual  reminder, providing the sort field is
1294              being displayed.  The  sort  field  might  not  be  visible
1295              because:
1296                  1) there is insufficient Screen Width
1297                  2) the `f' interactive command turned it Off
1298
1299              Note:  Whenever  Searching and/or Other Filtering is active
1300              in a window, column highlighting is  temporarily  disabled.
1301              See  the  notes  at the end of topics 5d. SEARCHING and 5e.
1302              FILTERING for an explanation why.
1303
1304
1305          y  :Row-Highlight toggle
1306              Changes highlighting for "running" tasks.   For  additional
1307              insight into this task state, see topic 3a. DESCRIPTIONS of
1308              Fields, the `S' field (Process Status).
1309
1310              Use of this provision provides important insight into  your
1311              system's  health.   The only costs will be a few additional
1312              tty escape sequences.
1313
1314
1315          z  :Color/Monochrome toggle
1316              Switches the `current' window between your last used  color
1317              scheme  and  the  older form of black-on-white or white-on-
1318              black.  This command will alter both the summary  area  and
1319              task  area but does not affect the state of the `x', `y' or
1320              `b' toggles.
1321
1322
1323       CONTENT of task window
1324
1325
1326          c  :Command-Line/Program-Name toggle
1327              This command will be honored whether  or  not  the  COMMAND
1328              column is currently visible.  Later, should that field come
1329              into view, the change you applied will be seen.
1330
1331
1332          f | F  :Fields-Management
1333              These keys display a separate screen where you  can  change
1334              which  fields are displayed, their order and also designate
1335              the sort field.  For additional information on these inter‐
1336              active commands see topic 3b. MANAGING Fields.
1337
1338
1339          o | O  :Other-Filtering
1340              You  will be prompted for the selection criteria which then
1341              determines which tasks will be shown in the `current'  win‐
1342              dow.   Your criteria can be made case sensitive or case can
1343              be ignored.  And you determine if  top  should  include  or
1344              exclude matching tasks.
1345
1346              See  topic  5e.  FILTERING in a window for details on these
1347              and additional related interactive commands.
1348
1349
1350          S  :Cumulative-Time-Mode toggle
1351              When Cumulative mode is On, each process is listed with the
1352              cpu time that it and its dead children have used.
1353
1354              When  Off, programs that fork into many separate tasks will
1355              appear less demanding.  For programs like `init' or a shell
1356              this is appropriate but for others, like compilers, perhaps
1357              not.  Experiment with two task  windows  sharing  the  same
1358              sort field but with different `S' states and see which rep‐
1359              resentation you prefer.
1360
1361              After issuing this command, you'll be informed of  the  new
1362              state  of  this  toggle.   If  you  wish to know in advance
1363              whether or not Cumulative mode is in effect, simply ask for
1364              help and view the window summary on the second line.
1365
1366
1367          u | U  :Show-Specific-User-Only
1368              You  will  be  prompted  for the uid or name of the user to
1369              display.  The -u option matches on  effective user  whereas
1370              the  -U option matches on any user (real, effective, saved,
1371              or filesystem).
1372
1373              Thereafter, in that task window only matching users will be
1374              shown,  or possibly no processes will be shown.  Prepending
1375              an exclamation point ('!') to the user id or name instructs
1376              top  to  display only processes with users not matching the
1377              one provided.
1378
1379              Different task windows can  be  used  to  filter  different
1380              users.   Later,  if  you wish to monitor all users again in
1381              the `current' window, re-issue this command but just  press
1382              <Enter> at the prompt.
1383
1384
1385          V  :Forest-View-Mode toggle
1386              In  this  mode,  processes are reordered according to their
1387              parents and the layout of the COMMAND column resembles that
1388              of  a  tree.   In  forest view mode it is still possible to
1389              toggle between program name and command line (see  the  `c'
1390              interactive  command) or between processes and threads (see
1391              the `H' interactive command).
1392
1393              Note: Typing any key affecting the  sort  order  will  exit
1394              forest  view  mode  in the `current' window.  See topic 4c.
1395              TASK AREA Commands, SORTING for information on those keys.
1396
1397
1398       SIZE of task window
1399
1400
1401          i  :Idle-Process toggle
1402              Displays all tasks or just active tasks.  When this  toggle
1403              is  Off,  tasks  that  have not used any CPU since the last
1404              update will not be displayed.  However, due to  the  granu‐
1405              larity  of  the  %CPU  and TIME+ fields, some processes may
1406              still be displayed that appear to have used no CPU.
1407
1408              If this command is applied to the last task display when in
1409              alternate-display  mode,  then  it will not affect the win‐
1410              dow's size, as all prior task displays  will  have  already
1411              been painted.
1412
1413
1414          n | #  :Set-Maximum-Tasks
1415              You  will  be prompted to enter the number of tasks to dis‐
1416              play.  The lessor of your number and available screen  rows
1417              will be used.
1418
1419              When  used  in  alternate-display mode, this is the command
1420              that gives you precise control over the size of  each  cur‐
1421              rently  visible task display, except for the very last.  It
1422              will not affect the last window's size, as all  prior  task
1423              displays will have already been painted.
1424
1425              Note:  If you wish to increase the size of the last visible
1426              task  display  when  in  alternate-display   mode,   simply
1427              decrease the size of the task display(s) above it.
1428
1429       SORTING of task window
1430
1431          For  compatibility,  this  top  supports most of the former top
1432          sort keys.  Since this is primarily a  service  to  former  top
1433          users, these commands do not appear on any help screen.
1434                command   sorted-field                  supported
1435                A         start time (non-display)      No
1436                M         %MEM                          Yes
1437                N         PID                           Yes
1438                P         %CPU                          Yes
1439                T         TIME+                         Yes
1440
1441          Before using any of the following sort provisions, top suggests
1442          that you temporarily turn on column highlighting using the  `x'
1443          interactive  command.   That  will  help ensure that the actual
1444          sort environment matches your intent.
1445
1446          The following interactive commands will only  be  honored  when
1447          the current sort field is visible.  The sort field might not be
1448          visible because:
1449                1) there is insufficient Screen Width
1450                2) the `f' interactive command turned it Off
1451
1452
1453             <  :Move-Sort-Field-Left
1454                 Moves the sort column to the  left  unless  the  current
1455                 sort field is the first field being displayed.
1456
1457
1458             >  :Move-Sort-Field-Right
1459                 Moves  the  sort  column to the right unless the current
1460                 sort field is the last field being displayed.
1461
1462
1463          The following  interactive  commands  will  always  be  honored
1464          whether or not the current sort field is visible.
1465
1466
1467             f | F  :Fields-Management
1468                 These  keys  display  a  separate  screen  where you can
1469                 change which field is used as  the  sort  column,  among
1470                 other functions.  This can be a convenient way to simply
1471                 verify the current sort field,  when  running  top  with
1472                 column highlighting turned Off.
1473
1474
1475             R  :Reverse/Normal-Sort-Field toggle
1476                 Using this interactive command you can alternate between
1477                 high-to-low and low-to-high sorts.
1478
1479
1480          Note: Field sorting uses internal values, not those  in  column
1481          display.   Thus,  the  TTY and WCHAN fields will violate strict
1482          ASCII collating sequence.
1483
1484
1485   4d. COLOR Mapping
1486       When you issue the `Z' interactive command, you will be  presented
1487       with  a  separate  screen.   That screen can be used to change the
1488       colors in just the `current' window or in all four windows  before
1489       returning to the top display.
1490
1491
1492       The following interactive commands are available.
1493           4 upper case letters to select a target
1494           8 numbers to select a color
1495           normal toggles available
1496               B         :bold disable/enable
1497               b         :running tasks "bold"/reverse
1498               z         :color/mono
1499           other commands available
1500               a/w       :apply, then go to next/prior
1501               <Enter>   :apply and exit
1502               q         :abandon current changes and exit
1503
1504       If  you use `a' or `w' to cycle the targeted window, you will have
1505       applied the color scheme that was displayed  when  you  left  that
1506       window.  You can, of course, easily return to any window and reap‐
1507       ply different colors or turn colors Off completely  with  the  `z'
1508       toggle.
1509
1510       The  Color Mapping screen can also be used to change the `current'
1511       window/field group in either full-screen mode or alternate-display
1512       mode.   Whatever was targeted when `q' or <Enter> was pressed will
1513       be made current as you return to the top display.
1514

5. ALTERNATE-DISPLAY Provisions

1516   5a. WINDOWS Overview
1517       Field Groups/Windows:
1518          In full-screen mode there is a single window represented by the
1519          entire screen.  That single window can still be changed to dis‐
1520          play 1 of 4 different field groups  (see  the  `g'  interactive
1521          command,  repeated  below).   Each  of the 4 field groups has a
1522          unique separately configurable summary area and its own config‐
1523          urable task area.
1524
1525          In  alternate-display mode, those 4 underlying field groups can
1526          now be made visible simultaneously, or can be turned Off  indi‐
1527          vidually at your command.
1528
1529          The  summary area will always exist, even if it's only the mes‐
1530          sage line.  At any given time only one summary area can be dis‐
1531          played.   However,  depending  on your commands, there could be
1532          from zero to four separate task displays currently  showing  on
1533          the screen.
1534
1535       Current Window:
1536          The  `current' window is the window associated with the summary
1537          area and the window to which task related commands  are  always
1538          directed.   Since  in alternate-display mode you can toggle the
1539          task display Off, some commands might  be  restricted  for  the
1540          `current' window.
1541
1542          A  further  complication arises when you have toggled the first
1543          summary area line Off.  With the loss of the window  name  (the
1544          `l'  toggled  line),  you'll not easily know what window is the
1545          `current' window.
1546
1547
1548   5b. COMMANDS for Windows
1549          - | _  :Show/Hide-Window(s) toggles
1550              The `-' key turns the `current' window's  task  display  On
1551              and  Off.   When  On, that task area will show a minimum of
1552              the columns header you've established with the `f' interac‐
1553              tive  command.   It  will  also reflect any other task area
1554              options/toggles you've applied yielding zero or more tasks.
1555
1556              The `_' key does the same for all task displays.  In  other
1557              words,  it switches between the currently visible task dis‐
1558              play(s) and any task display(s) you had  toggled  Off.   If
1559              all 4 task displays are currently visible, this interactive
1560              command will leave the summary area  as  the  only  display
1561              element.
1562
1563
1564       *  = | +  :Equalize-(reinitialize)-Window(s)
1565              The  `='  key forces the `current' window's task display to
1566              be visible.  It also reverses any  `i'  (idle  tasks),  `n'
1567              (max  tasks),  `u/U' (user filter) and `o/O' (other filter)
1568              commands that might be active.  Also,  if  the  window  had
1569              been  scrolled,  it  will  be reset with this command.  See
1570              topic 5c. SCROLLING a  Window  for  additional  information
1571              regarding vertical and horizontal scrolling.
1572
1573              The  `+'  key does the same for all windows.  The four task
1574              displays will reappear, evenly balanced.   They  will  also
1575              have   retained   any  customizations  you  had  previously
1576              applied, except for the `i' (idle tasks), `n' (max  tasks),
1577              `u/U'  (user  filter),  `o/O'  (other filter) and scrolling
1578              interactive commands.
1579
1580
1581       *  A  :Alternate-Display-Mode toggle
1582              This command  will  switch  between  full-screen  mode  and
1583              alternate-display mode.
1584
1585              The  first  time you issue this command, all four task dis‐
1586              plays will be shown.  Thereafter when you switch modes, you
1587              will  see  only  the  task display(s) you've chosen to make
1588              visible.
1589
1590
1591       *  a | w  :Next-Window-Forward/Backward
1592              This will  change  the  `current'  window,  which  in  turn
1593              changes  the  window to which commands are directed.  These
1594              keys act in a circular fashion so you can reach any desired
1595              window using either key.
1596
1597              Assuming  the  window name is visible (you have not toggled
1598              `l' Off), whenever the  `current'  window  name  loses  its
1599              emphasis/color,  that's  a reminder the task display is Off
1600              and many commands will be restricted.
1601
1602
1603       *  g  :Choose-Another-Window/Field-Group
1604              You will be prompted to enter a number between 1 and 4 des‐
1605              ignating the field group which should be made the `current'
1606              window.
1607
1608              In full-screen mode, this command is necessary to alter the
1609              `current'  window.  In alternate-display mode, it is simply
1610              a less convenient alternative to the `a' and `w' commands.
1611
1612
1613          G  :Change-Window/Field-Group-Name
1614              You will be prompted for a new name to be  applied  to  the
1615              `current' window.  It does not require that the window name
1616              be visible (the `l' toggle to be On).
1617
1618
1619       *  The interactive commands shown with an asterisk (`*') have  use
1620          beyond alternate-display mode.
1621              =, A, g    are always available
1622              a, w       act the same with color mapping
1623                         and fields management
1624
1625
1626   5c. SCROLLING a Window
1627       Typically  a  task window is a partial view into a systems's total
1628       tasks/threads which shows only some of the  available  fields/col‐
1629       umns.   With  these  scrolling keys, you can move that view verti‐
1630       cally or horizontally to reveal any desired task or column.
1631
1632
1633       Up,PgUp  :Scroll-Tasks
1634           Move the view up toward the first task row,  until  the  first
1635           task  is displayed at the top of the `current' window.  The Up
1636           arrow key moves a single line while PgUp  scrolls  the  entire
1637           window.
1638
1639
1640       Down,PgDn  :Scroll-Tasks
1641           Move  the  view  down toward the last task row, until the last
1642           task is the only task displayed at the top  of  the  `current'
1643           window.   The  Down  arrow  key moves a single line while PgDn
1644           scrolls the entire window.
1645
1646
1647       Left,Right  :Scroll-Columns
1648           Move the view of displayable fields horizontally one column at
1649           a time.
1650
1651           Note:  As  a reminder, some fields/columns are not fixed-width
1652           but allocated all remaining screen width when  visible.   When
1653           scrolling  right  or left, that feature may produce some unex‐
1654           pected results initially.
1655
1656           Additionally, there are special provisions  for  any  variable
1657           width field when positioned as the last displayed field.  Once
1658           that field is reached via the right arrow key, and is thus the
1659           only  column  shown,  you  can continue scrolling horizontally
1660           within such a field.  See the `C'  interactive  command  below
1661           for additional information.
1662
1663
1664       Home  :Jump-to-Home-Position
1665           Reposition the display to the un-scrolled coordinates.
1666
1667
1668       End  :Jump-to-End-Position
1669           Reposition  the  display so that the rightmost column reflects
1670           the last displayable field and the bottom task row  represents
1671           the last task.
1672
1673           Note:  From  this position it is still possible to scroll down
1674           and right using the arrow keys.  This is true until  a  single
1675           column and a single task is left as the only display element.
1676
1677
1678       C  :Show-scroll-coordinates toggle
1679           Toggle  an  informational  message which is displayed whenever
1680           the message line is not otherwise being  used.   That  message
1681           will take one of two forms depending on whether or not a vari‐
1682           able width column has also been scrolled.
1683
1684             scroll coordinates: y = n/n (tasks), x = n/n (fields)
1685             scroll coordinates: y = n/n (tasks), x = n/n (fields) + nn
1686
1687           The coordinates shown as n/n are relative to  the  upper  left
1688           corner  of the `current' window.  The additional `+ nn' repre‐
1689           sents the displacement into a variable width  column  when  it
1690           has  been  scrolled horizontally.  Such displacement occurs in
1691           normal 8 character tab stop amounts via  the  right  and  left
1692           arrow keys.
1693
1694
1695           y = n/n (tasks)
1696               The  first  n  represents  the topmost visible task and is
1697               controlled by scrolling keys.  The  second  n  is  updated
1698               automatically to reflect total tasks.
1699
1700
1701           x = n/n (fields)
1702               The  first  n represents the leftmost displayed column and
1703               is controlled by scrolling keys.   The  second  n  is  the
1704               total number of displayable fields and is established with
1705               the `f' interactive command.
1706
1707
1708       The above interactive commands are always available in full-screen
1709       mode  but  never  available in alternate-display mode if the `cur‐
1710       rent' window's task display has been toggled Off.
1711
1712       Note: When any form of filtering is active, you  can  expect  some
1713       slight aberrations when scrolling since not all tasks will be vis‐
1714       ible.  This is particularly apparent when using the Up/Down  arrow
1715       keys.
1716
1717
1718   5d. SEARCHING in a Window
1719       You  can  use these interactive commands to locate a task row con‐
1720       taining a particular value.
1721
1722
1723       L  :Locate-a-string
1724           You will be prompted for the case-sensitive string  to  locate
1725           starting  from  the  current window coordinates.  There are no
1726           restrictions on search string content.
1727
1728           Searches are not limited to values from a single field or col‐
1729           umn.  All of the values displayed in a task row are allowed in
1730           a search string.  You may include spaces, numbers, symbols and
1731           even forest view artwork.
1732
1733           Keying  <Enter> with no input will effectively disable the `&'
1734           key until a new search string is entered.
1735
1736
1737       &  :Locate-next
1738           Assuming a  search  string  has  been  established,  top  will
1739           attempt to locate the next occurrence.
1740
1741
1742       When  a  match is found, the current window is repositioned verti‐
1743       cally so the task row containing that string is first.  The scroll
1744       coordinates  message  can  provide  confirmation  of such vertical
1745       repositioning  (see  the  `C'  interactive  command).   Horizontal
1746       scrolling, however, is never altered via searching.
1747
1748       The  availability  of  a matching string will be influenced by the
1749       following factors.
1750
1751          a. Which fields are displayable from the total available,
1752             see topic 3b. MANAGING Fields.
1753
1754          b. Scrolling a window vertically and/or horizontally,
1755             see topic 5c. SCROLLING a Window.
1756
1757          c. The state of the command/command-line toggle,
1758             see the `c' interactive command.
1759
1760          d. The stability of the chosen sort column,
1761             for example PID is good but %CPU bad.
1762
1763
1764       If  a  search  fails,  restoring   the   `current'   window   home
1765       (unscrolled) position, scrolling horizontally, displaying command-
1766       lines or choosing a more stable sort field  could  yet  produce  a
1767       successful `&' search.
1768
1769       The above interactive commands are always available in full-screen
1770       mode but never available in alternate-display mode  if  the  `cur‐
1771       rent' window's task display has been toggled Off.
1772
1773       Note:  Whenever a Search is active in a window, top will turn col‐
1774       umn highlighting Off to prevent false matches on internal non-dis‐
1775       play  escape sequences.  Such highlighting will be restored when a
1776       window's search string is empty.  See the `x' interactive  command
1777       for additional information on sort column highlighting.
1778
1779
1780   5e. FILTERING in a Window
1781       You  can use this Other Filter feature to establish selection cri‐
1782       teria which will then determine which tasks are shown in the `cur‐
1783       rent' window.
1784
1785       Establishing  a  filter requires: 1) a field name; 2) an operator;
1786       and 3) a selection value, as a minimum.  This is the most  complex
1787       of top's user input requirements so, when you make a mistake, com‐
1788       mand recall will be your friend.  Remember the Up/Down arrow  keys
1789       or their aliases when prompted for input.
1790
1791       Filter Basics
1792
1793          1. field names are case sensitive and spelled as in the header
1794
1795          2. selection values need not comprise the full displayed field
1796
1797          3. a selection is either case insensitive or sensitive to case
1798
1799          4. the default is inclusion, prepending `!' denotes exclusions
1800
1801          5. multiple selection criteria can be applied to a task window
1802
1803          6. inclusion and exclusion criteria can be used simultaneously
1804
1805          7. the 1 equality and 2 relational filters can be freely mixed
1806
1807          8. separate unique filters are maintained for each task window
1808
1809          If  a  field is not turned on or is not currently in view, then
1810          your selection criteria will not affect  the  display.   Later,
1811          should  a filtered field become visible, the selection criteria
1812          will then be applied.
1813
1814       Keyboard Summary
1815
1816         o  :Other-Filter (lower case)
1817             You will be prompted to establish a filter that ignores case
1818             when matching.
1819
1820
1821         O  :Other-Filter (upper case)
1822             You will be prompted to establish a case sensitive filter.
1823
1824
1825        ^O  :Show-Active-Filters (Ctrl key + `o')
1826             This  can serve as a reminder of which filters are active in
1827             the `current' window.  A summary will be shown on  the  mes‐
1828             sage line until you press the <Enter> key.
1829
1830
1831         =  :Reset-Filtering in current window
1832             This  clears all of your selection criteria in the `current'
1833             window.  It also has additional impact so please  see  topic
1834             4a. GLOBAL Commands.
1835
1836
1837         +  :Reset-Filtering in all windows
1838             This  clears the selection criteria in all windows, assuming
1839             you are in alternate-display mode.  As with the `=' interac‐
1840             tive  command,  it  too  has  additional consequences so you
1841             might wish to see topic 5b. COMMANDS for Windows.
1842
1843       Input Requirements
1844
1845          When prompted for selection criteria, the data you provide must
1846          take one of two forms.  There are 3 required pieces of informa‐
1847          tion, with a 4th as optional.  These examples  use  spaces  for
1848          clarity but your input generally would not.
1849                  #1           #2  #3              ( required )
1850                  Field-Name   ?   include-if-value
1851               !  Field-Name   ?   exclude-if-value
1852               #4                                  ( optional )
1853
1854          Items #1, #3 and #4 should be self-explanatory.  Item #2 repre‐
1855          sents both a required delimiter and the operator which must  be
1856          one of either equality (`=') or relation (`<' or `>').
1857
1858          The  `='  equality  operator  requires only a partial match and
1859          that can reduce your `if-value' input requirements.  The `>' or
1860          `<' relational operators always employ string comparisons, even
1861          with numeric fields.  They are designed to work with a  field's
1862          default  justification  and  with  homogeneous data.  When some
1863          field's numeric amounts have been subjected  to  scaling  while
1864          others have not, that data is no longer homogeneous.
1865
1866          If  you  establish a relational filter and you have changed the
1867          default Numeric or  Character  justification,  that  filter  is
1868          likely  to fail.  When a relational filter is applied to a mem‐
1869          ory field and you have not changed the scaling, it may  produce
1870          misleading   results.    This  happens,  for  example,  because
1871          `100.0m' (MiB) would appear greater than  `1.000g'  (GiB)  when
1872          compared as strings.
1873
1874          If your filtered results appear suspect, simply altering justi‐
1875          fication or scaling may yet achieve the desired objective.  See
1876          the `j', `J' and `e' interactive commands for additional infor‐
1877          mation.
1878
1879       Potential Problems
1880
1881          These GROUP filters could produce the exact same results or the
1882          second one might not display anything at all, just a blank task
1883          window.
1884               GROUP=root        ( only the same results when )
1885               GROUP=ROOT        ( invoked via lower case `o' )
1886
1887          Either of these RES filters  might  yield  inconsistent  and/or
1888          misleading  results,  depending  on  the current memory scaling
1889          factor.  Or both filters could produce the exact same results.
1890               RES>9999          ( only the same results when )
1891               !RES<10000        ( memory scaling is at `KiB' )
1892
1893          This nMin filter  illustrates  a  problem  unique  to  scalable
1894          fields.   This particular field can display a maximum of 4 dig‐
1895          its, beyond which values are automatically  scaled  to  KiB  or
1896          above.   So  while  amounts  greater than 9999 exist, they will
1897          appear as 2.6m, 197k, etc.
1898               nMin>9999         ( always a blank task window )
1899
1900       Potential Solutions
1901
1902          These examples illustrate how Other Filtering can be creatively
1903          applied  to  achieve  almost any desired result.  Single quotes
1904          are sometimes shown to delimit the spaces which are part  of  a
1905          filter  or  to  represent a request for status (^O) accurately.
1906          But if you used them with if-values in real  life,  no  matches
1907          would be found.
1908
1909          Assuming  field  nTH is displayed, the first filter will result
1910          in only multi-threaded processes being shown.  It also  reminds
1911          us that a trailing space is part of every displayed field.  The
1912          second filter achieves the exact same results with less typing.
1913               !nTH=` 1 '                ( ' for clarity only )
1914               nTH>1                     ( same with less i/p )
1915
1916          With Forest View mode active and the COMMAND  column  in  view,
1917          this  filter effectively collapses child processes so that just
1918          3 levels are shown.
1919               !COMMAND=`       `- '     ( ' for clarity only )
1920
1921          The final two filters appear  as  in  response  to  the  status
1922          request  key (^O).  In reality, each filter would have required
1923          separate input.  The PR example shows the two  concurrent  fil‐
1924          ters  necessary to display tasks with priorities of 20 or more,
1925          since some might be negative.  Then by exploiting trailing spa‐
1926          ces, the nMin series of filters could achieve the failed `9999'
1927          objective discussed above.
1928               `PR>20' + `!PR=-'         ( 2 for right result )
1929               `!nMin=0 ' + `!nMin=1 ' + `!nMin=2 ' + `!nMin=3 ' ...
1930
1931       Note: Whenever Other Filtering is active in  a  window,  top  will
1932       turn  column highlighting Off to prevent false matches on internal
1933       non-display escape sequences.  Such highlighting will be  restored
1934       when  a  window  is  no  longer subject to filtering.  See the `x'
1935       interactive command for  additional  information  on  sort  column
1936       highlighting.
1937
1938

6. FILES

1940   6a. SYSTEM Configuration File
1941       The presence of this file will influence which version of the help
1942       screen is shown to an ordinary user.  More  importantly,  it  will
1943       limit  what  ordinary users are allowed to do when top is running.
1944       They will not be able to issue the following commands.
1945           k        Kill a task
1946           r        Renice a task
1947           d or s   Change delay/sleep interval
1948
1949       The system configuration file is not created by top.  Rather,  you
1950       create this file manually and place it in the /etc directory.  Its
1951       name must be `toprc' and must have no leading  `.'  (period).   It
1952       must have only two lines.
1953
1954       Here is an example of the contents of /etc/toprc:
1955           s        # line 1: secure mode switch
1956           5.0      # line 2: delay interval in seconds
1957
1958
1959   6b. PERSONAL Configuration File
1960       This  file is written as `$HOME/.your-name-4-top' + `rc'.  Use the
1961       `W' interactive command to create it or update it.
1962
1963       Here is the general layout:
1964           global   # line  1: the program name/alias notation
1965             "      # line  2: id,altscr,irixps,delay,curwin
1966           per ea   # line  a: winname,fieldscur
1967           window   # line  b: winflags,sortindx,maxtasks,graph modes
1968             "      # line  c: summclr,msgsclr,headclr,taskclr
1969           global   # line 15: additional miscellaneous settings
1970             "      # any remaining lines are devoted to the
1971             "      # generalized inspect provisions
1972             "      # discussed below
1973
1974       If the $HOME variable is not present, top will try  to  write  the
1975       personal  configuration  file to the current directory, subject to
1976       permissions.
1977
1978
1979   6c. ADDING INSPECT Entries
1980       To exploit the `Y' interactive command, you must  add  entries  at
1981       the end of the top personal configuration file.  Such entries sim‐
1982       ply reflect a file to be read or command/pipeline to  be  executed
1983       whose  results  will  then  be displayed in a separate scrollable,
1984       searchable window.
1985
1986       If you don't know the location or name of your top rcfile, use the
1987       `W' interactive command to rewrite it and note those details.
1988
1989       Inspect  entries can be added with a redirected echo or by editing
1990       the configuration file.  Redirecting an echo risks overwriting the
1991       rcfile should it replace (>) rather than append (>>) to that file.
1992       Conversely, when using an editor care must be taken not to corrupt
1993       existing  lines,  some  of  which will contain unprintable data or
1994       unusual characters.
1995
1996       Those Inspect entries beginning with a `#' character are  ignored,
1997       regardless  of content.  Otherwise they consist of the following 3
1998       elements, each of which must be separated by a tab character (thus
1999       2 `\t' total):
2000
2001         .type:  literal `file' or `pipe'
2002         .name:  selection shown on the Inspect screen
2003         .fmts:  string representing a path or command
2004
2005       The  two  types of Inspect entries are not interchangeable.  Those
2006       designated `file' will be accessed using fopen and must  reference
2007       a  single  file in the `.fmts' element.  Entries specifying `pipe'
2008       will employ  popen,  their  `.fmts'  element  could  contain  many
2009       pipelined commands and, none can be interactive.
2010
2011       If the file or pipeline represented in your `.fmts' deals with the
2012       specific PID input or accepted  when  prompted,  then  the  format
2013       string  must  also  contain  the `%d' specifier, as these examples
2014       illustrate.
2015
2016         .fmts=  /proc/%d/numa_maps
2017         .fmts=  lsof -P -p %d
2018
2019       For `pipe' type entries only, you may also wish to redirect stderr
2020       to stdout for a more comprehensive result.  Thus the format string
2021       becomes:
2022
2023         .fmts=  pmap -x %d 2>&1
2024
2025       Here are examples of both types of Inspect entries as  they  might
2026       appear  in the rcfile.  The first entry will be ignored due to the
2027       initial `#' character.  For clarity,  the  pseudo  tab  depictions
2028       (^I)  are  surrounded  by an extra space but the actual tabs would
2029       not be.
2030
2031         # pipe ^I Sockets ^I lsof -n -P -i 2>&1
2032         pipe ^I Open Files ^I lsof -P -p %d 2>&1
2033         file ^I NUMA Info ^I /proc/%d/numa_maps
2034         pipe ^I Log ^I tail -n100 /var/log/syslog | sort -Mr
2035
2036       Except for the commented entry above,  these  next  examples  show
2037       what  could  be  echoed  to  achieve similar results, assuming the
2038       rcfile name was `.toprc'.  However, due to the embedded tab  char‐
2039       acters,  each of these lines should be preceded by `/bin/echo -e',
2040       not just a simple an `echo', to  enable  backslash  interpretation
2041       regardless of which shell you use.
2042
2043         "pipe\tOpen Files\tlsof -P -p %d 2>&1" >> ~/.toprc
2044         "file\tNUMA Info\t/proc/%d/numa_maps" >> ~/.toprc
2045         "pipe\tLog\ttail -n200 /var/log/syslog | sort -Mr" >> ~/.toprc
2046
2047       Caution:  If  any  inspect  entry  you create produces output with
2048       unprintable characters they will be displayed  in  either  the  ^C
2049       notation or hexadecimal <FF> form, depending on their value.  This
2050       applies to tab characters as well, which will show  as  `^I'.   If
2051       you  want  a  truer  representation,  any  embedded tabs should be
2052       expanded.
2053
2054         # next would have contained `\t' ...
2055         # file ^I <your_name> ^I /proc/%d/status
2056         # but this will eliminate embedded `\t' ...
2057         pipe ^I <your_name> ^I cat /proc/%d/status | expand -
2058
2059       The above example takes what could have been a  `file'  entry  but
2060       employs a `pipe' instead so as to expand the embedded tabs.
2061
2062       Note:  While  `pipe'  type entries have been discussed in terms of
2063       pipelines and commands, there  is  nothing  to  prevent  you  from
2064       including   shell  scripts  as  well.   Perhaps even newly created
2065       scripts designed specifically for the `Y' interactive command.
2066
2067       Lastly, as the number of your Inspect entries grows over time, the
2068       `Options:'  row  will  be truncated when screen width is exceeded.
2069       That does not affect operation other than to make some  selections
2070       invisible.
2071
2072       However,  if  some  choices are lost to truncation but you want to
2073       see more options, there is an easy solution hinted at below.
2074
2075         Inspection Pause at pid ...
2076         Use:  left/right then <Enter> ...
2077         Options:  help  1  2  3  4  5  6  7  8  9  10  11 ...
2078
2079       The entries in the top rcfile would have a number for the  `.name'
2080       element  and the `help' entry would identify a shell script you've
2081       written explaining what those numbered selections  actually  mean.
2082       In that way, many more choices can be made visible.
2083
2084

7. STUPID TRICKS Sampler

2086       Many  of  these  tricks  work  best when you give top a scheduling
2087       boost.  So plan on starting him with a nice value of -10, assuming
2088       you've got the authority.
2089
2090
2091   7a. Kernel Magic
2092       For these stupid tricks, top needs full-screen mode.
2093
2094
2095       ·  The  user  interface,  through  prompts and help, intentionally
2096          implies that the delay interval is limited to tenths of a  sec‐
2097          ond.   However,  you're  free to set any desired delay.  If you
2098          want to see Linux at his scheduling best, try a  delay  of  .09
2099          seconds or less.
2100
2101          For this experiment, under x-windows open an xterm and maximize
2102          it.  Then do the following:
2103            . provide a scheduling boost and tiny delay via:
2104                nice -n -10 top -d.09
2105            . keep sorted column highlighting Off so as to
2106              minimize path length
2107            . turn On reverse row highlighting for emphasis
2108            . try various sort columns (TIME/MEM work well),
2109              and normal or reverse sorts to bring the most
2110              active processes into view
2111
2112          What you'll see is a very busy Linux  doing  what  he's  always
2113          done  for you, but there was no program available to illustrate
2114          this.
2115
2116
2117       ·  Under an xterm using `white-on-black' colors,  on  top's  Color
2118          Mapping  screen  set  the  task color to black and be sure that
2119          task highlighting is set to bold, not reverse.   Then  set  the
2120          delay interval to around .3 seconds.
2121
2122          After bringing the most active processes into view, what you'll
2123          see are the ghostly images of just the currently running tasks.
2124
2125
2126       ·  Delete the existing rcfile, or create  a  new  symlink.   Start
2127          this  new  version  then  type `T' (a secret key, see topic 4c.
2128          Task Area Commands, SORTING) followed by `W' and `q'.  Finally,
2129          restart the program with -d0 (zero delay).
2130
2131          Your  display  will be refreshed at three times the rate of the
2132          former top, a 300% speed advantage.  As  top  climbs  the  TIME
2133          ladder,  be  as patient as you can while speculating on whether
2134          or not top will ever reach the top.
2135
2136
2137   7b. Bouncing Windows
2138       For these stupid tricks, top needs alternate-display mode.
2139
2140
2141       ·  With 3 or 4 task displays visible, pick any window  other  than
2142          the last and turn idle processes Off using the `i' command tog‐
2143          gle.  Depending on where you  applied  `i',  sometimes  several
2144          task  displays  are  bouncing and sometimes it's like an accor‐
2145          dion, as top tries his best to allocate space.
2146
2147
2148       ·  Set each window's summary lines differently: one with no memory
2149          ('m');  another with no states ('t'); maybe one with nothing at
2150          all, just the message line.  Then hold  down  `a'  or  `w'  and
2151          watch a variation on bouncing windows  --  hopping windows.
2152
2153
2154       ·  Display all 4 windows and for each, in turn, set idle processes
2155          to Off using the `i' command toggle.  You've just  entered  the
2156          "extreme bounce" zone.
2157
2158
2159   7c. The Big Bird Window
2160       This stupid trick also requires alternate-display mode.
2161
2162
2163       ·  Display all 4 windows and make sure that 1:Def is the `current'
2164          window.  Then, keep increasing window size with the `n'  inter‐
2165          active  command  until  all the other task displays are "pushed
2166          out of the nest".
2167
2168          When they've all  been  displaced,  toggle  between  all  visi‐
2169          ble/invisible  windows using the `_' command toggle.  Then pon‐
2170          der this:
2171             is top fibbing or telling honestly your imposed truth?
2172
2173
2174   7d. The Ol' Switcheroo
2175       This stupid trick works best without alternate-display mode, since
2176       justification is active on a per window basis.
2177
2178
2179       ·  Start  top  and  make  COMMAND the last (rightmost) column dis‐
2180          played.  If necessary, use the `c' command  toggle  to  display
2181          command  lines  and ensure that forest view mode is active with
2182          the `V' command toggle.
2183
2184          Then use the up/down arrow keys to position the display so that
2185          some  truncated command lines are shown (`+' in last position).
2186          You may have to resize your xterm to produce truncation.
2187
2188          Lastly, use the `j' command toggle to make the  COMMAND  column
2189          right justified.
2190
2191          Now  use the right arrow key to reach the COMMAND column.  Con‐
2192          tinuing with the right arrow key, watch closely  the  direction
2193          of travel for the command lines being shown.
2194
2195             some lines travel left, while others travel right
2196
2197             eventually all lines will Switcheroo, and move right
2198
2199

8. BUGS

2201       To report bugs, follow the instructions at:
2202           http://www.debian.org/Bugs/Reporting
2203
2204

9. HISTORY Former top

2206       The  original  top  was  written  by  Roger Binns, based on Branko
2207       Lankester's <lankeste@fwi.uva.nl> ps program.
2208
2209       Robert Nation <nation@rocket.sanders.lockheed.com> adapted it  for
2210       the proc file system.
2211
2212       Helmut  Geyer  <Helmut.Geyer@iwr.uni-heidelberg.de>  added support
2213       for configurable fields.
2214
2215       Plus many other individuals contributed over the years.
2216
2217

10. AUTHOR

2219       This entirely new and enhanced replacement was written by:
2220           Jim Warner, <james.warner@comcast.net>
2221
2222       With invaluable help from:
2223           Craig Small, <csmall@enc.com.au>
2224           Albert Cahalan, <albert@users.sf.net>
2225
2226
2227

11. SEE Also

2229       free(1), ps(1), uptime(1), atop(1), slabtop(1), vmstat(8), w(1).
2230
2231
2232
2233procps-ng                       July 2014                          TOP(1)
Impressum