mahmood mahmood - 1 year ago 57
Linux Question

finding the process numbers of a multithread application

How can I retrieve the process numbers of a issued multithread application? I mean, I am looking for a bash script that after executing a command, puts the process numbers in a list. For example:

./run_program -nt 4
# find the list of PIDs

Answer Source

I would use pgrep for checking the process ids.

If you're only looking at child PID of the current process, you can use the -P option:

pgrep -P $$
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download