[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: killing ALL of a user's processes at once



Hi Guilherme,

>     I was wondering if there's a way to kill all of a user's processes
> at once... This would be VERY useful in cases like today, when I made a
> little mistake in my crontab and a process that should be started at
> 6h00 am was started once for each minute between 6h00 and 7h00... OK, it
> was VERY stupid to put * 6 on the crontab instead of 00 6, but then the
> only solution I found to stop all those 60 processes that were running
> when I got here, at 9h00, was to reboot the machine...

Oh Oh ...

If all processes are the created from the same program, say
/usr/local/bin/foo, then "killall /usr/local/bin/foo" would solve your
problem.  This is probably what you wanted this morning.

If you are trying to kill off all processes started by a certain user
try somthing like

# kill `ps aux | awk '/<userid>/ { print $2 }'`

So long -- Stephan
-- 
Stephan Engelke                                    engelke@math.uni-hamburg.de
*** Microsoft leads to fear, fear leads to anger, anger leads to hate and
                  hate leads to suffering.  --  Master Yoda (more or less) ***


Reply to: