[kanchilug] 1D1C - ps

  • From: Dhana Sekar <tkdhanasekar@xxxxxxxxx>
  • To: ILUG-C <ilugc@xxxxxxxxxxxxx>, kanchilug@xxxxxxxxxxxxx
  • Date: Sat, 22 Jun 2013 22:09:28 +0530

command: ps
purpose: report a snapshot of the current processes.
syntax: $ps options

command line options
This version of ps accepts several kinds of options.

Unix98 options may be grouped and must be preceeded by a dash.
BSD options may be grouped and must not be used with a dash.
GNU long options are preceeded by two dashes.

examples:

1. To see every process on the system using standard syntax:
          $ps -e
          $ps -ef
          $ps -eF
          $ps -ely
2. To see every process on the system using BSD syntax:
          $ps ax
          $ps axu
3. To print a process tree:
          $ps -ejH
          $ps axjf
4. To get info about threads:
          $ps -eLf
          $ps axms

5.  To get security info:
          $ps -eo euser,ruser,suser,fuser,f,comm,label
          $ps axZ
          $ps -eM

6.  To see every process running as root (real & effective ID) in user
     format:
          $ps -U root -u root u

7.  To see every process with a user-defined format:
          $ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
          $ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm
          $ps -eopid,tt,user,fname,tmout,f,wchan

8.  To Print only the process IDs of syslogd:
          $ps -C syslogd -o pid=

9.  To Print only the name of PID 80:
          $ps -p 80 -o comm=


regards,
dhanasekar

Other related posts: