Determine which application is using a given port

You can find information about your network connections using netstat.

# t = Show sockets using the TCP protocol.    
# u = Show sockets using the UDP protocol.    
# l = Show only listening sockets.    
# p = Show the PID and name of the program to which each socket belongs.     
# n = Show numerical addresses instead of trying to determine symbolic host, port or user names. 
$ sudo netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:17500           0.0.0.0:*               LISTEN      2228/dropbox        
tcp        0      0 127.0.0.1:17600         0.0.0.0:*               LISTEN      2228/dropbox