Skip to content

Instantly share code, notes, and snippets.

@derryl
Created November 20, 2013 19:03
Show Gist options
  • Save derryl/7568993 to your computer and use it in GitHub Desktop.
Save derryl/7568993 to your computer and use it in GitHub Desktop.
A helpful function for "Fatal error: Port XX is already in use" issues.
# Usage: killp 35729
# killp 80
killp() {
PID=$(lsof -i:$1 | grep 'username' | awk '{print $2}')
if [ $PID ]; then
kill $PID;
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment