How to get a mapping of Pid to Port

lsofnetworkingprocess

I have a process which I need to run on a specific port. I have started some other process on that port and I need to kill it.

Unfortunately, I don't remember the name/pid of the other process so I need a quick way to find which PID are associated with it.

I tried lsof -i :7080 but that returned nothing. I can telnet localhost 7080 so I know its running.

For reference I'm running RHEL5

Best Answer

Try:

netstat -nap | grep 7080
Related Question