Home Explore Blog CI



man-pages

32th chunk of `top.man`
fc6f7f5ac40be7a2cde248203515290a0f1ad0582bc6593c0000000100001003
 GROUP=ROOT        ( invoked via lower case ‘o’ )

          Either of these RES filters might yield inconsistent and/or misleading results, depending on the current memory scaling factor.  Or both filters could produce the exact same results.
               RES>9999          ( only the same results when )
               !RES<10000        ( memory scaling is at ‘KiB’ )

          This nMin filter illustrates a problem unique to scalable fields.  This particular field can display a maximum of 4 digits, beyond which values are automatically scaled to KiB or above.  So  while  amounts  greater
          than 9999 exist, they will appear as 2.6m, 197k, etc.
               nMin>9999         ( always a blank task window )

       Potential Solutions

          These  examples  illustrate  how Other Filtering can be creatively applied to achieve almost any desired result.  Single quotes are sometimes shown to delimit the spaces which are part of a filter or to represent a
          request for status (^O) accurately.  But if you used them with if‐values in real life, no matches would be found.

          Assuming field nTH is displayed, the first filter will result in only multi‐threaded processes being shown.  It also reminds us that a trailing space is part of every displayed field.  The  second  filter  achieves
          the exact same results with less typing.
               !nTH=‘ 1 ’                ( ‘ for clarity only )
               nTH>1                     ( same with less i/p )

          With Forest View mode active and the COMMAND column in view, this filter effectively collapses child processes so that just 3 levels are shown.
               !COMMAND=‘       ‘‐ ’     ( ‘ for clarity only )

          The  final  two filters appear as in response to the status request key (^O).  In reality, each filter would have required separate input.  The PR example shows the two concurrent filters necessary to display tasks
          with priorities of 20 or more, since some might be negative.  Then by exploiting trailing spaces, the nMin series of filters could achieve the failed ‘9999’ objective discussed above.
               ‘PR>20’ + ‘!PR=‐’         ( 2 for right result )
               ‘!nMin=0 ’ + ‘!nMin=1 ’ + ‘!nMin=2 ’ + ‘!nMin=3 ’ ...

6. FILES
   6a. PERSONAL Configuration File
       This file is created or updated via the ‘W’ interactive command.

       The legacy version is written as ‘$HOME/.your-name-4-top’ + ‘rc’ with a leading period.

       A newly created configuration file is written as procps/your-name-4-top’ + ‘rc’ without a leading period.  The procps directory will be subordinate to either $XDG_CONFIG_HOME when  set  as  an  absolute  path  or  the
       $HOME/.config directory.

       While not intended to be edited manually, here is the general layout:
           global   # line  1: the program name/alias notation
             "      # line  2: id,altscr,irixps,delay,curwin
           per ea   # line  a: winname,fieldscur
           window   # line  b: winflags,sortindx,maxtasks,etc
             "      # line  c: summclr,msgsclr,headclr,taskclr
           global   # line 15: additional miscellaneous settings
             "      # any remaining lines are devoted to optional
             "      # active ‘other filters’ discussed in section 5e above
             "      # plus ‘inspect’ entries discussed in section 6b below

       If a valid absolute path to the rcfile cannot be established, customizations made to a running top will be impossible to preserve.

   6b. ADDING INSPECT Entries
       To exploit the ‘Y’ interactive command, you must add entries at the end of the top personal configuration file.  Such entries simply reflect a file to be read or command/pipeline to be executed whose results will then
       be displayed in a separate scrollable, searchable window.

       If you don’t know the location or name of your top rcfile, use the ‘W’ interactive command to rewrite it and note those details.

Title: Top Command: Filtering Solutions, Configuration Files, and Inspect Entries
Summary
This section provides solutions to filtering problems in the 'top' command, illustrating creative applications using examples with multi-threaded processes, collapsing child processes in Forest View mode, and displaying tasks with specific priorities. It describes how to achieve desired results through concurrent filters and exploiting trailing spaces. It then details the structure and location of the personal configuration file used by 'top', including its layout and significance for preserving customizations. Lastly, it explains how to add inspect entries to the configuration file to exploit the 'Y' interactive command, allowing users to display the results of a file or command in a separate window.