3 Matching Annotations
  1. Feb 2021
    1. ps --forest -o pid,tty,stat,time,cmd -g $(ps -o sid= -p 2795)
    2. To get all the processes spawned by a process the whole tree needs to be built. I used awk for that. At first it builds a hash array to contain all PID => ,child,child... . At the end it calls a recursive function to extract all the child processes of a given process. The result is passed to another ps to format the result.