How to do display all pid number of a parent process id in unix.

ps ile pid (child)+ ppid number(parent) ve prosess’lere ait diğer  ekstra bilgileri almak gayet basit.

ps -o user,pcpu,pmem,pid,ppid,command axx –forest | grep  ‘apache’ | sort

apache    0.0 17.0 11944 32311  \_ /usr/sbin/httpd
apache    0.6 18.1 11946 32311  \_ /usr/sbin/httpd
apache    0.6 18.1 11948 32311  \_ /usr/sbin/httpd
apache    0.6 18.1 11953 32311  \_ /usr/sbin/httpd
apache    0.7 18.1 11945 32311  \_ /usr/sbin/httpd
apache    0.7 18.1 11952 32311  \_ /usr/sbin/httpd
apache    0.9 18.4 11949 32311  \_ /usr/sbin/httpd
apache    1.0 18.1 11947 32311  \_ /usr/sbin/httpd
apache    1.0 18.4 11950 32311  \_ /usr/sbin/httpd
apache    1.1 18.4 11951 32311  \_ /usr/sbin/httpd
apache    3.1 18.1 12150 32311  \_ /usr/sbin/httpd

Yukarıdaki komut; “apache” isimli kullanıcıya ait prosess,memory,pid(prosess id),ppid(parent prosess id) ve prosess’in bağlı olduğu forest’ları sort ederek gösterir. Ek olarak , PPID numarası bilinen bir prosess’in tüm child prosess’leri de aşağıdaki komut ile tespit edilebilir.

pstree -p 32311 -n

httpd(32311)ââ¬âpipelog(12421)

             ââhttpd(12422)
             ââhttpd(12423)
             ââhttpd(12424)
             ââhttpd(12425)
             ââhttpd(12426)
             ââhttpd(12427)
             ââhttpd(12428)
             ââhttpd(12429)
             ââhttpd(12430)
             ââhttpd(12431)

Share on Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>