Paul Maunders | Web log
Economics, Business, Telecoms, Tech and Gadgets

Killing Processes

June 29th, 2008 by Paul Maunders

Previously if I had wanted to kill a bulk list of mysql processes I would have done something like:

ps auxww | grep ^mysql | awk '{print $2}' | xarg kill -9

Today I discovered two really handy commands that make listing and killing processes a lot easier, pkill and pgrep.

You can achieve the same result as above with:

pkill -9 -u mysql mysql

This will kill all processes owned by the mysql user that have mysql in their name.

Posted in linux

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.