Kill process listening on a TCP port
Here's a tiny shell script I use to quickly kill of whatever process is hogging a TCP port.
$ cat portkill.sh
#!/bin/sh
lsof -i :$1 | awk '{print $2}' | tail -n 1 | xargs kill -9
Usage:
# kills process on port 8000
$ ./portkill.sh 8000
Written by Zoheb Sait
Related protips
1 Response

very handy!
can we get something like this for windows, and runs without admin rights?
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Process
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#