3 Matching Annotations
- Feb 2021
-
unix.stackexchange.com unix.stackexchange.com
-
ps -o pid,pgid,stat,args
-
-
-
ps --forest -o pid,tty,stat,time,cmd -g $(ps -o sid= -p 2795)
-
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.
-