Skip to content

Instantly share code, notes, and snippets.

@mdeous
Created January 17, 2012 02:45
Show Gist options
  • Save mdeous/1624238 to your computer and use it in GitHub Desktop.
Save mdeous/1624238 to your computer and use it in GitHub Desktop.
kill all matching processes
killthem () {
for PID in `ps aux | grep -v grep | grep $1 | awk '{print $2}'`
do
(
kill -9 $PID &> /dev/null && echo "Killed $PID"
) || echo "Failed to kill $PID"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment