Para isso, eu costumo usar lsof
com a opção de mostrar as portas em uso.
Veja um exemplo:
[root@localhost ~]# lsof -Pi | grep myprog
myprog 23411 user 9u IPv6 9828537 0t0 TCP 1.2.3.167:51163->1.2.3.54:8090 (ESTABLISHED)
myprog 23411 user 16u IPv4 9827813 0t0 TCP 1.2.3.167:60783->1.2.3.186:23 (ESTABLISHED)
myprog 23411 user 23u IPv4 9827817 0t0 TCP 192.168.2.8:37435->192.168.2.1:20003 (ESTABLISHED)
myprog 23411 user 24u IPv4 9827815 0t0 TCP 192.168.2.8:38942->192.168.2.1:20001 (ESTABLISHED)
myprog 23411 user 30u IPv4 9849168 0t0 TCP 1.2.3.167:52352 (LISTEN)
myprog 23411 user 31u IPv4 9849242 0t0 TCP 1.2.3.167:52352->1.2.3.186:59323 (ESTABLISHED)
myprog 23411 user 33u IPv4 9852370 0t0 TCP 1.2.3.167:40328 (LISTEN)
[root@localhost ~]#