Skip to content

Instantly share code, notes, and snippets.

@Magnuti
Created March 7, 2024 14:34
Show Gist options
  • Save Magnuti/16b5941b5b70700d65f0917ce19e868b to your computer and use it in GitHub Desktop.
Save Magnuti/16b5941b5b70700d65f0917ce19e868b to your computer and use it in GitHub Desktop.
Useful .zshrc stuff
# Command for terminating process on a port number
# $ kill_on_port <port_number>
function kill_on_port() {
if [ $# -eq 0 ]
then
echo "Please provide a port number"
return
fi
if [ -z "$1" ]
then
echo "No port supplied"
return
fi
kill -9 $(lsof -ti:$1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment