Skip to content

Instantly share code, notes, and snippets.

@asross
Last active August 29, 2015 14:02
Show Gist options
  • Save asross/d2131fcff56a1278f680 to your computer and use it in GitHub Desktop.
Save asross/d2131fcff56a1278f680 to your computer and use it in GitHub Desktop.
# execute e.g.
# $ kill_matching phantomjs
function kill_matching {
export matchee=$1
ruby -e 'puts `ps aux | grep #{`echo $matchee`}`.split("\n").each{|l| `kill -9 #{l.split[1]}` unless l.include?("grep") }'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment