LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 03-30-2004, 03:38 PM   #1
vladS
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.


Vlad.
 
Old 03-30-2004, 05:42 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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


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

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

Thanks for the clue.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:39 PM.

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