Home Explore Blog CI



man-pages

7th chunk of `ps.man`
5a0ceb66d3773d0b6978095a63c9d67f325726d1d06356a40000000100000faf
 STANDARD FORMAT SPECIFIERS section.  The "+"  is  optional  since
              default direction is increasing numerical or lexicographic order.
              Identical to --sort.

                      Examples:
                      ps jaxkuid,-ppid,+pid
                      ps axk comm o comm,args
                      ps kstart_time -ef

       --lines n
              Set screen height.

       n      Numeric output for WCHAN and USER (including all types of UID and
              GID).

       --no-headers
              Print  no  header line at all.  --no-heading is an alias for this
              option.

       O order
              Sorting order (overloaded).  The BSD O option  can  act  like  -O
              (user-defined  output  format with some common fields predefined)
              or can be used to specify sort order.   Heuristics  are  used  to
              determine  the  behavior  of  this  option.   To  ensure that the
              desired behavior is obtained (sorting or formatting), specify the
              option in some other way (e.g.  with -O or --sort).

              For    sorting,    obsolete    BSD    O    option    syntax    is
              O[+|-]k1[,[+|-]k2[,...]].    It   orders  the  processes  listing
              according to the multilevel sort specified  by  the  sequence  of
              one-letter  short keys k1,k2, ...  described in the OBSOLETE SORT
              KEYS  section  below.   The "+"  is  currently  optional,  merely
              re-iterating  the  default  direction  on  a key, but may help to
              distinguish an O  sort  from  an  O  format.   The  "-"  reverses
              direction only on the key it precedes.

       --rows n
              Set screen height.

       S      Sum  up  some  information,  such  as  CPU usage, from dead child
              processes into their parent.  This  is  useful  for  examining  a
              system  where  a  parent process repeatedly forks off short-lived
              children to do work.

       --sort spec
              Specify     sorting      order.       Sorting      syntax      is
              [+|-]key[,[+|-]key[,...]].   Choose  a  multi-letter key from the
              STANDARD FORMAT SPECIFIERS section.  The "+"  is  optional  since
              default direction is increasing numerical or lexicographic order.
              Identical to k.  For example: ps jax --sort=uid,-ppid,+pid

       w      Wide output.  Use this option twice for unlimited width.

       -w     Wide output.  Use this option twice for unlimited width.

       --width n
              Set screen width.

THREAD DISPLAY
       H      Show threads as if they were processes.

       -L     Show threads, possibly with LWP and NLWP columns.

       m      Show threads after processes.

       -m     Show threads after processes.

       -T     Show threads, possibly with SPID column.

OTHER INFORMATION
       --help section
              Print a help message.  The section argument can be one of simple,
              list,  output,  threads,  misc,  or  all.   The  argument  can be
              shortened to one of the underlined letters as in: s|l|o|t|m|a.

       --info Print debugging info.

       L      List all format specifiers.

       V      Print the procps‐ng version.

       -V     Print the procps‐ng version.

       --version
              Print the procps‐ng version.

NOTES
       This ps works by reading the virtual files in /proc.  This ps  does  not
       need  to be setuid kmem or have any privileges to run.  Do not give this
       ps any special permissions.

       CPU usage is currently expressed as the percentage of time spent running
       during the entire lifetime of a process.  This is not ideal, and it does
       not conform to the standards that ps otherwise conforms to.   CPU  usage
       is unlikely to add up to exactly 100%.

       The  SIZE  and  RSS fields don’t count some parts of a process including

Title: ps - Sorting, Thread Display, and Other Options
Summary
This section details options for controlling the output of the `ps` command. It includes sorting options (`O`, `--sort`), which allow specifying sort order based on various keys. It also covers thread display options (`H`, `-L`, `m`, `-m`, `-T`), enabling the viewing of threads alongside processes. Additional options include setting screen dimensions (`--lines`, `--rows`, `--width`), summing CPU usage from dead child processes (`S`), and displaying help messages (`--help`). Finally, it notes that `ps` operates by reading virtual files in `/proc` and does not require special privileges.