geek @ mountain
runwuf's tech scratch pad
Thursday, December 8, 2011
# of threads in a process under Linux
How to check number of threads in a process under Linux? top doesn't show it, but option "m" in ps will.
I put a space in front and after PID so it doesn't grep longer PID that contains the shorter PID in same sequence.
ps -elm | grep " $PID " | grep -v grep | wc -l
e.g.
ps -elm | grep " 9919 " | grep -v grep | wc -l
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment