If you mean which process uses (listening or connecting with) your ports, use the following command:
netstat -a -b -o -n
-a will show you all the connections (even if they are in the LISTENING state)
-b will show you the application executable that uses this port
-o will show you the application PID
-n will not perform dns translations (you probably do not need this knowledge for the application), not necessarily
source share