2 ms·
If we want to kill the process listening on a specific port, we can do that with a simple shell script: http://aaronblohowiak.com/how-to-kill-the-process-listen
by aaronblohowiak 15y ago
If we want to kill the process listening on a specific port, we can do that with a simple shell script: http://aaronblohowiak.com/how-to-kill-the-process-listening-on-a-specif http://aaronblohowiak.com/how-to-kill-the-process-listening-...
Similarly, most versions of lsof support built-in filtering of TCP ports by status:
lsof -iTCP -sTCP:LISTEN -P
will show you the open TCP ports without having to use grep (which discards the header.)
- sciurus 15y agoUnless I misunderstand it, your shell script can be replaced with fuser, e.g. 'fuser -k -9 1337/tcp'
- aaronblohowiak 15y agoOh sweet! I didn't know about fuser. Thanks!