Sometimes a program is using a particular port, preventing another program from capturing and using it. It can be difficult to trace down which process exactly is using the port. Fortunately, there are a couple helpful utilities which can link each process with the port(s) it is using.
Windows
On Windows, download and run CurrPorts. It will display a table of the currently running processes and the ports they are using. It is possible to sort by process name or the port number to make it easy to find the desired port. CurrPorts is freeware by NirSoft.

Linux
On Linux, this functionality is built-in with the lsof or netstat commands. Both of these commands display the open ports, but each gives somewhat different information:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
$ lsof -i tcp rhythmbox 9643 user 38u IPv4 7807452 0t0 TCP myhostname.local:32922->xxx.xxx.xxx.xxx:www (CLOSE_WAIT) dropbox 9657 user 19u IPv4 7812811 0t0 TCP myhostname.local:52059->www.dropbox.com:https (CLOSE_WAIT) dropbox 9657 user 23u IPv4 7812913 0t0 TCP *:17500 (LISTEN) dropbox 9657 user 24u IPv4 44107433 0t0 TCP myhostname.local:39794->xxx.xxx.xxx.xxx-static.reverse.softlayer.com:https (CLOSE_WAIT) telepathy 13299 user 9u IPv4 44161959 0t0 TCP myhostname.local:60768->xxx.xxx.xxx.xxx:https (ESTABLISHED) chrome 16881 user 168u IPv4 44071467 0t0 TCP myhostname.local:40527->xxx.xxx.xxx.xxx:https (ESTABLISHED) $ lsof -i udp COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME skype 9627 user 19u IPv4 7804873 0t0 UDP localhost:42966 skype 9627 user 39u IPv4 7804926 0t0 UDP *:2805 dropbox 9657 user 18u IPv4 7812909 0t0 UDP *:17500 $ netstat -pl (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:2805 *:* LISTEN 9627/skype tcp 0 0 *:ssh *:* LISTEN - tcp 0 0 localhost:ipp *:* LISTEN - tcp 0 0 *:17500 *:* LISTEN 9657/dropbox tcp6 0 0 localhost:ipp [::]:* LISTEN - udp 0 0 *:mdns *:* - udp 0 0 localhost:42966 *:* 9627/skype udp 0 0 *:bootpc *:* - udp 0 0 *:bootpc *:* - udp 0 0 *:2805 *:* 9627/skype udp 0 0 *:51959 *:* - udp 0 0 *:17500 *:* 9657/dropbox |
Mac OS X
The syntax on Mac OS X is similar to Linux, except it may be necessary to specify the protocol with netstat:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ netstat -pl tcp (Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.) Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 *:2805 *:* LISTEN 9627/skype tcp 0 0 *:ssh *:* LISTEN - tcp 0 0 localhost:ipp *:* LISTEN - tcp 0 0 *:17500 *:* LISTEN 9657/dropbox tcp6 0 0 localhost:ipp [::]:* LISTEN - udp 0 0 *:mdns *:* - udp 0 0 localhost:42966 *:* 9627/skype udp 0 0 *:bootpc *:* - udp 0 0 *:bootpc *:* - udp 0 0 *:2805 *:* 9627/skype udp 0 0 *:51959 *:* - udp 0 0 *:17500 *:* 9657/dropbox |





