What program is using port x?

netstat can be used to figure out what program is using a port.

$ netstat -nlp
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:22              0.0.0.0:*               LISTEN      1096/sshd
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1733/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      1096/sshd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   PID/Program name    Path
unix  2      [ ACC ]     STREAM     LISTENING     6338     1071/gdm-simple-sla @/tmp/gdm-greeter-LvjLQPzT
unix  2      [ ACC ]     STREAM     LISTENING     5165     1072/X              /tmp/.X11-unix/X0

If you have a lot open then grep can be used to only find what you are looking for

netstat -nlp|grep :22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1096/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1096/sshd

For windows, simply start with

netstat -n