Skip to content

Instantly share code, notes, and snippets.

@yevhene
Last active October 20, 2015 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yevhene/483aba86ae23d81c41ca to your computer and use it in GitHub Desktop.
Save yevhene/483aba86ae23d81c41ca to your computer and use it in GitHub Desktop.
Kills the first greped process passed by an argument.
function shoot() {
local pid=`ps x \
| grep '$@' \
| grep -v grep \
| head -n1 \
| awk '{ print $1 }'
kill -9 $pid
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment