Skip to content

Instantly share code, notes, and snippets.

@l-portet
Created July 3, 2020 16:30
Show Gist options
  • Save l-portet/af59ee9abbd997535c29fb73722105ac to your computer and use it in GitHub Desktop.
Save l-portet/af59ee9abbd997535c29fb73722105ac to your computer and use it in GitHub Desktop.
Fish function that kill the process listening on a specific port
# Fish function that kill the process listening on a specific port
# Usage: kill-port <port>
function kill-port
lsof -n -i:$argv | grep LISTEN | awk '{ print $2 }' | uniq | xargs kill -9
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment