stat.rst
changeset 1871 7b9c756a5b8c
parent 1869 f779ff33178e
child 1872 da4694ae72cb
equal deleted inserted replaced
1870:6d3eb4fdcb47 1871:7b9c756a5b8c
    21   $ ps -e
    21   $ ps -e
    22 
    22 
    23 View process commands::
    23 View process commands::
    24 
    24 
    25   $ ps -e -o pid,cmd
    25   $ ps -e -o pid,cmd
       
    26 
       
    27 View parent process id of selected process::
       
    28 
       
    29   $ ps -p $PID -o ppid=
    26 
    30 
    27 Show processes with same substring in command::
    31 Show processes with same substring in command::
    28 
    32 
    29   $ pgrep -f $SUBSTR
    33   $ pgrep -f $SUBSTR
    30   $ pgrep -l -f $SUBSTR
    34   $ pgrep -l -f $SUBSTR
   124   http://htop.sourceforge.net/
   128   http://htop.sourceforge.net/
   125                 home page
   129                 home page
   126 
   130 
   127 Linux static.
   131 Linux static.
   128 -------------
   132 -------------
       
   133 
       
   134 Number of cores::
       
   135 
       
   136   $ nproc
       
   137 
       
   138 Process affinity::
       
   139 
       
   140   $ taskset -p $PID
       
   141 
   129 ::
   142 ::
   130 
   143 
   131   $ ps -eo %cpu,pid,cmd --sort=%cpu
   144   $ ps -eo %cpu,pid,cmd --sort=%cpu
       
   145   $ pidstat
       
   146   $ mpstat
       
   147 
       
   148 CPU context switches::
       
   149 
       
   150   $ pidstat -w
   132 
   151 
   133 FreeBSD interactive.
   152 FreeBSD interactive.
   134 --------------------
   153 --------------------
   135 ::
   154 ::
   136 
   155