


the IDs of the threads a $pid has started. The pstree pipes will also include the thread ids, i.e.This was very useful ! – Michal Gallovic Feb 11 ’16 at 20:43.However your answer comes the closest to what seesm to be achievable in Linux, so I’ll accept it. Child processes are arbitrary and may or may not use process groups themselves (I cannot assume anything).

Share Improve this answerFollowanswered Jul 14 ’13 at 19:01 Jander 14.7k55 gold badges4343 silver badges6565 bronze badges The only caveat here is that process groups do not nest, so if some process is creating its own process groups, its subprocesses will no longer be in the group that you created. Or you could again turn to Perl: perl -e 'setpgid or die exec my_command args If you’d like to have a process run in its own process group, you can use the ‘pgrphack’ tool from the Debian package ‘daemontools’: pgrphack my_command args 1)please Read, Subscribe First and then comment if it works for you.THANKS(2)Post email address for download link(3)Please follow the instruction to get a. So I also think that process groups are the way to go. There’s only so far text processing can take you. But if the command name contains a parenthesized number, all bets are off. We’re looking for numbers within parentheses so that we don’t, for example, give 2 as a child process when we run across gif2png(3012). Or with Perl: pstree -p $pid | perl -ne 'print "$1\n" while /\((\d+)\)/g' The following is somewhat simpler, and has the added advantage of ignoring numbers in the command names: pstree -p $pid | grep -o '(\+)' | grep -o '\+' Is there any command, or any simpler way to get the full list of all descendant processes? 8 Answers
