[BBLISA] To kill a process tree

Dean Anderson dean at av8.com
Fri Apr 3 14:50:02 EDT 2009


There is an easy way:

ps -eo pid,user,args,pgrp --sort pgrp

Find your pgid in the last column

kill -KILL -<pgid>


		--Dean

On Thu, 2 Apr 2009, Edward Ned Harvey wrote:

> I know if I simply "kill pid" then the process and all its children will die.  But I don't want to kill them.  I want to "kill -SIGTSTP pid" ... and this works as long as I name all the pids in the process tree.  It does not cascade the signal to all the child processes if I only name the parent pid.
> 
> Does anybody know a way to send a specific kill signal to a all the descendents of some specific pid?
> 
> FWIW - I read the kill man page, and it's riddled with errors.  The most annoying one was ...
> 
>  *
> (from man kill) -p Specify that kill should only print the process id (pid) of the named processes, and not send any signals.
>  *
> So then I did this:
> [harveyed at gotham ~]$ ps
> PID TTY          TIME CMD
> 6382 pts/18   00:00:00 bash
> 20595 pts/18   00:00:00 ps
> 
> And:   kill -KILL -p 6382
> unfortunately kills my present terminal.   D'Oh!!
> 

-- 
Av8 Internet   Prepared to pay a premium for better service?
www.av8.net         faster, more reliable, better service
617 344 9000   





More information about the bblisa mailing list