Skip to content

Instantly share code, notes, and snippets.

@deltaepsilon
Created June 19, 2024 16:21
Show Gist options
  • Save deltaepsilon/39f3e62ccf92d0de5cfc24303eceb72d to your computer and use it in GitHub Desktop.
Save deltaepsilon/39f3e62ccf92d0de5cfc24303eceb72d to your computer and use it in GitHub Desktop.
Shell function to kill processes on a port
killport() {
if [ -z "$1" ]; then
echo "Usage: killport <port>"
return 1
fi
lsof -ti:$1 | xargs kill -9
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment