Find out which process is listening on a port

I needed to find out which process is listening on a port the other day and a quick search on SO showed me the way and all you need is to run:

netstat –aon | find /i "listening"

and you will get a list of the ports and the PID of the process listening on that port:

image 

Sweet!

  • meow

    cmd: netstat -an | findstr portnumber
    unix: ps -ef | grep portnumber | grep LIST
    unix: ps -ef | grep protnumber | grep EST