Skip to content

Instantly share code, notes, and snippets.

@sandro
Created June 24, 2011 16:40
Show Gist options
  • Save sandro/1045173 to your computer and use it in GitHub Desktop.
Save sandro/1045173 to your computer and use it in GitHub Desktop.
Kill a process by grepping for a name
pkill() {
if [ $1 ]; then
kill `ps -ef | grep $1 | grep -v 'grep' | awk '{print $2}'`
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment