Getting thread count for proc in linux

来源:互联网 发布:纯html商城源码 编辑:程序博客网 时间:2024/06/06 03:32
One of the developers at the company that I work for has asked me how to see number of threads per process. And I don't know how to do that. I'm using RedHat ES3.

I know in solaris you can see number of treads per process in top command, but linux version doesn't give this information. So my question is how to see thread count in linux?




You could probably abuse ps with some filtering...

start with 

ps -A -mPl

Then you can find the children belonging to the
PPID you're after and count them ... 




I did ps -elm|grep $pid|grep -v grep |wc -l
and it worked.

原创粉丝点击