问题:
这个是一个进程,并且21263是21326的父进程,如果我知道某个子进程的ID号,如何找到他的父进程是哪个?
prod 21326 21263 0 02:04:41 ? 0:00 /p05/product/oracle10g/iAS/bin/httpd -d /p05/
最好是用:ps -ef --forest
-l,l long u user-oriented --sort --tty --forest --version
\_ sshd: xiangdong [priv]
| \_ sshd: xiangdong@pts/7,pts/17,pts/10,pts/14,pts/15
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| | \_ su -
| | \_ -bash
| | \_ ps aux --forest
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| \_ su -
| \_ -bash
| \_ [httpmut: master process] H?????5?"
如nginx和php-fpm:
root 32550 1 0 2014 ? 00:00:00 nginx: master process ../sbin/nginx
www 730 32550 0 Jan26 ? 00:00:01 \_ nginx: worker process
www 731 32550 0 Jan26 ? 00:00:00 \_ nginx: worker process
www 732 32550 0 Jan26 ? 00:00:01 \_ nginx: worker process
root 6482 1 0 2014 ? 00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
www 6483 6482 0 2014 ? 00:05:20 \_ php-fpm: pool www
www 6484 6482 0 2014 ? 00:05:26 \_ php-fpm: pool www
和ps aux|grep nginx一样的结果。
——————————————————————————————————————————————————
方法一:
lsof好像可以:
方法二:
ps -ef|awk '$2 ~ /pid/{print $2}'
pid :子进程ID
ps -ef|awk '$2 ~ /10555/{print $2}'
方法三:
ps -ef --forest
www 10555 1 0 15:08 pts/6 00:00:00 [httpmut: worker process] H????
摘处:http://bbs.chinaunix.net/thread-1810739-1-1.html
这个是一个进程,并且21263是21326的父进程,如果我知道某个子进程的ID号,如何找到他的父进程是哪个?
prod 21326 21263 0 02:04:41 ? 0:00 /p05/product/oracle10g/iAS/bin/httpd -d /p05/
最好是用:ps -ef --forest
-l,l long u user-oriented --sort --tty --forest --version
\_ sshd: xiangdong [priv]
| \_ sshd: xiangdong@pts/7,pts/17,pts/10,pts/14,pts/15
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| | \_ su -
| | \_ -bash
| | \_ ps aux --forest
| \_ -bash
| | \_ su -
| | \_ -bash
| \_ -bash
| \_ su -
| \_ -bash
| \_ [httpmut: master process] H?????5?"
如nginx和php-fpm:
root 32550 1 0 2014 ? 00:00:00 nginx: master process ../sbin/nginx
www 730 32550 0 Jan26 ? 00:00:01 \_ nginx: worker process
www 731 32550 0 Jan26 ? 00:00:00 \_ nginx: worker process
www 732 32550 0 Jan26 ? 00:00:01 \_ nginx: worker process
root 6482 1 0 2014 ? 00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
www 6483 6482 0 2014 ? 00:05:20 \_ php-fpm: pool www
www 6484 6482 0 2014 ? 00:05:26 \_ php-fpm: pool www
和ps aux|grep nginx一样的结果。
——————————————————————————————————————————————————
方法一:
lsof好像可以:
方法二:
ps -ef|awk '$2 ~ /pid/{print $2}'
pid :子进程ID
ps -ef|awk '$2 ~ /10555/{print $2}'
方法三:
ps -ef --forest
www 10555 1 0 15:08 pts/6 00:00:00 [httpmut: worker process] H????
摘处:http://bbs.chinaunix.net/thread-1810739-1-1.html
作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:https://jackxiang.com/post/7761/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!
最后编辑: jackxiang 编辑于2015-1-28 14:41
评论列表
2020-3-15 17:41 | 1
写的什么乱七八糟的玩意?
分页: 1/1 1