Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-30-2004, 03:38 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 2

Rep: Reputation: 0
Getting thread count for proc in linux

Hi all,
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?

Thanks in advance.

Old 03-30-2004, 05:42 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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 ...

Old 03-31-2004, 04:28 PM   #3
LQ Newbie
Registered: Mar 2004
Posts: 2

Original Poster
Rep: Reputation: 0
I did ps -elm|grep $pid|grep -v grep |wc -l
and it worked.

Thanks for the clue.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
WARNING: Hard link count is wrong for /proc Fr33B5D Linux - General 1 08-30-2005 06:41 PM
line count mismatch between AIX and Linux after ftp cool244 AIX 7 03-15-2005 10:22 AM
Should posts in general count on your post count? Joey.Dale General 16 01-27-2004 01:31 AM
make your linux count! e1000 Linux - Distributions 1 11-04-2003 12:28 PM
%CPU , Memory Usage, Thread count srinivasar Programming 0 09-20-2003 03:56 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration