How do i list processes using the most cpu or memory using the bsd ps command?



  • The first line is the header line so using number 6.

           --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
    

    Memory.

    $ ps aux --sort=pmem | head -n 6
    

    CPU.

    $ ps aux --sort=pcpu | head -n 6
    


© Lightnetics 2024