Linux查看进程的所有子进程和线程

Linux  /  houtizong 发布于 3年前   152

得到进程的pid:
ps -ef | grep process_name | grep -v "grep" | awk '{print $2}'

查看进程的所有线程
# ps mp 6648 -o THREAD,tid
USER %CPU PRI SCNT WCHAN USER SYSTEM TID
root 0.0 - - - - - -
root 0.0 24 - - - - 6648
root 0.0 21 - - - - 6650
root 1.0 24 - - - - 14214
root 0.0 23 - futex_ - - 14216
root 0.0 22 - 184466 - - 15374
root 0.0 23 - 184466 - - 15376
root 0.0 23 - 184466 - - 15378
root 0.0 23 - 184466 - - 15380
root 0.0 23 - 184466 - - 15392
root 0.0 23 - 184466 - - 15394
root 0.0 23 - 184466 - - 15398

查看所有子进程:
# pstree -p 6648
agent_executor(6648)─┬─tar(15601)───gzip(15607)
├─{agent_executor}(6650)
├─{agent_executor}(14214)
├─{agent_executor}(14216)
├─{agent_executor}(15374)
├─{agent_executor}(15376)
├─{agent_executor}(15378)
├─{agent_executor}(15380)
├─{agent_executor}(15392)
├─{agent_executor}(15394)
└─{agent_executor}(15398)

 

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客