←back to thread

125 points lexokoh | 3 comments | | HN request time: 0.41s | source
1. faangguyindia ◴[] No.45001634[source]
On macOS i've this in my zshrc file:

`killport() { kill -9 $(lsof -t -i :$1 -sTCP:LISTEN) }`

i use it like killport 8000

replies(2): >>45001695 #>>45002400 #
2. lexokoh ◴[] No.45001695[source]
Nice. I have this too. I wanted something more visual and expansive.
3. porridgeraisin ◴[] No.45002400[source]
Yeah, I have a function `whoseport` which is just your subcommand. I usually manually type kill or whatever I want with `$(whoseport 3000)`