Skip to content

Instantly share code, notes, and snippets.

View etuchscherer's full-sized avatar

Eric Tuchscherer etuchscherer

  • Classmates
  • Seattle, WA
View GitHub Profile
@etuchscherer
etuchscherer / kop.sh
Created August 17, 2018 20:11 — forked from psheraton/kop.sh
Kill on Port (OSX)
#!/bin/bash
# Kill a process that is listening on a port
PORT=$1
PID=$(lsof -i tcp:$PORT | grep LISTEN |tr -s ' ' | cut -d ' ' -f 2)
if [ $PID ]; then
kill $PID
fi