For Windows, I think Process Explorer shows you all the threads under a process.
Is there a similar command line utility for Linux that can show me details about all the threads a particular process is spawning?
I think I should have made myself more clear. I do not want to see the process hierarcy, but a list of all the threads spawned by a particular process
See this screenshot
How can this be achieved in Linux? Thanks!
Best Answer
The classical tool
top
shows processes by default but can be told to show threads with theH
key press or-H
command line option. There is also htop, which is similar totop
but has scrolling and colors; it shows all threads by default (but this can be turned off).ps
also has a few options to show threads, especiallyH
and-L
.There are also GUI tools that can show information about threads, for example qps (a simple GUI wrapper around
ps
) or conky (a system monitor with lots of configuration options).For each process, a lot of information is available in
/proc/12345
where12345
is the process ID. Information on each thread is available in/proc/12345/task/67890
where67890
is the kernel thread ID. This is whereps
,top
and other tools get their information.