4 ms·
On macOS i've this in my zshrc file: `killport() { kill -9 $(lsof -t -i :$1 -sTCP:LISTEN) }` i use it like killport 8000
by faangguyindia 1y ago
On macOS i've this in my zshrc file:
`killport() {
kill -9 $(lsof -t -i :$1 -sTCP:LISTEN)
}`
i use it like killport 8000
- lexokoh 1y agoNice. I have this too. I wanted something more visual and expansive.
- porridgeraisin 1y agoYeah, I have a function `whoseport` which is just your subcommand. I usually manually type kill or whatever I want with `$(whoseport 3000)`