[NTLUG:Discuss] kill command
richard witt
imageek72 at gmail.com
Sat Jun 13 07:32:01 CDT 2009
On Sat, Jun 13, 2009 at 6:53 AM, Val Harris<valwharris at verizon.net> wrote:
> Ralph Green wrote:
>> Howdy,
>> I tried the following command and it does not quite work, and I don't
>> see why. Any suggestions?
>>
>> ps -A -o pid -o cmd | grep "update-notifier" | cut -c1-5 | kill
>>
>> If I do it without that last bit, I get the pid of the process I want
>> to kill. How do I need to change this to kill that process? I know it
>> will also get the pid of the grep command and kill that process, but I
>> can't see that that would hurt anything.
>> Good day,
>> Ralph
>>
>>
>>
>>
>
> assign the pid to a variable, ie: PID and then execute "kill $PID".
>
> --
>
> Val W. Harris valwharris at verizon.net
>
> "It's the hardest thing in the world to accept a little
> success and leave it that way." - Marlon Brando
i wrote a little one liner for this sometime back for evolution
because it would have a bunch of processes associated with it even
after i shut it down. I have since used it quite a few times for
different things
for pid in `ps aux |grep update-notifier |grep -v grep |awk '{print
$2}'`; do kill -9 $pid; done
More information about the Discuss
mailing list