• Uncategorized

About linux : How-to-find-process-using-TCP-port

Question Detail

After starting a http a couple of times I get this error like an instance of Go has not stopped!?

listen tcp :9000: bind: address already in use

I have experienced something like this with nodejs too but I was able to kill the process.. Unfortunately it seems like I can’t find the process id and kill it..

How to “free” the tcp port?

Question Answer

If you are on unix like system you can use netstat to find out which process is listening on a port:

sudo netstat -nlp | grep 9000

Turns out the -p option is not available on OS X. If you are using OS X you can do this:

lsof -n -i4TCP:$PORT | grep LISTEN

Who is listening on a given TCP port on Mac OS X?

You may also like...

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.