Skip to content

Instantly share code, notes, and snippets.

@kjellski
Created June 19, 2020 07:43
Show Gist options
  • Save kjellski/856fa4f40a84875a16e2a4cf59444cbc to your computer and use it in GitHub Desktop.
Save kjellski/856fa4f40a84875a16e2a4cf59444cbc to your computer and use it in GitHub Desktop.
kill a process running on a port
#!/bin/bash
lsof -n -i4TCP:$1 | awk '{print $2}' | tail -1 | xargs kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment