

This is still work in progress, I will update this as I improve the script. I was looking for the same, and was able to come up with the following bash script, (note: use either option -C command, or -p PID to select the process)ĭetails threads information of a process, using custom ps $ ps -L -o pid,lwp,pri,nice,start,stat,bsdtime,cmd,comm -C rsyslogd Threads information of a process, using ps -T ps -T -C rsyslogd UID PID PPID LWP C NLWP STIME TTY TIME CMD

Instant view of all process and threads, using ps -eLf $ ps -eLf Threads: 503 total, 2 running, 501 sleeping, 0 stopped, 0 zombie Realtime view of all or process, using top -H top - 16:24:42 up 3:49, 3 users, load average: 0.23, 0.29, 0.31 check the manpage for alternate options ( ps -m, ps m, ps H.) The command arguments example below are common ones.In the examples below, I have removed most process to keep the answer short.


Many program change the apparent name of the threads to something meaningful, the tools below can either display the binary name or that apparent name (check PID 1086 in the examples below).The two standard tools to show process informations are ps and top (and htop which is similar/ improved). Here's an example: $ ps -e -T | grep clementineĮach of these has the same PID so you know they are in the same process. grep this filters the contents by a (in this case ).Here's an example: $ ps -e -T -C clementine PID SPID TTY TIME CMD # this is here for clarity It does not work on MacOS or BSD, as there the -T parameter has a different meaning and there is no alternative to show threads. It depends if you want to look for a process id ( pid), for an application name, or more filters. There's also another option which is true CLI: ps. I would like to make it clear that each answer here is providing you with exactly what you have specified, a list of all threads associated with a process, this may not be obvious in htop as it, by default, lists all threads on the system, not just the process but top -H -p works better for example: top - 00:03:29 up 3 days, 14:49, 5 users, load average: 0.76, 0.33, 0.18 Listing threads under Linux Current provide answers
