Skip to content

Instantly share code, notes, and snippets.

@npyoung
Last active September 26, 2019 19:19
Show Gist options
  • Save npyoung/7f55165f9ce466f26e92e46aaa811231 to your computer and use it in GitHub Desktop.
Save npyoung/7f55165f9ce466f26e92e46aaa811231 to your computer and use it in GitHub Desktop.
Kill process on port
ports=$(lsof -t -i tcp:$1);
for port in $ports; do
echo "killing PID $port";
kill $port;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment