A parent process should always be running with N children process.I would like to run a script which will show/kill all children processes that don't have a parent process.$ ps faux | grep process.plroot 37140  0.3  0.1  61160 724   /process.pl [child]root 22079 10.2  0.3 127332 64620 /process.pl [master]root 22081  0.3  0.1  84752 26084   \_ /process.pl [child]
How to kill all processes that don't have specific parent process?
process;kill
pkill might work here:$ pkill -P 1 process.plThis kills all processes named process.pl whose parent is PID 1, which is what happens when a process's parent dies.