For example tomcat(PID is 4739) is initiated connection to postgress(Which is another server) to retrieve data from DB because, tomcat got the request from client(curl 192.168.1.12:8088/get). In this, tomcat uses a random tcp source port to connection postgress. Now, is there any way to get these source ports that was by created tomcat PID. I used netstat -tp, but I'm not getting PID of the connection. Getting PID only I use l - Listening like netstat -tlp. I tried to read PID sockets from /proc/PID/fd and then correlated to /proc/net/tcp. But I'm not seeing anything in /proc/net/tcp.NOTE: The topology like below. My requests(server1)<------->tomcat(server2)<-------->postgress(server2)UPDATE1netstat -tepn outputActive Internet connections (w/o servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program nametcp6       0      1 172.25.30.21:36598      xx.xx.xx.91:4343     SYN_SENT    0          42955126    9661/javatcp6       0      0 172.25.30.21:38340      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38064      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38282      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37520      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38286      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37654      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37906      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38152      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38124      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37412      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37374      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38126      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38252      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37224      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37800      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37780      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38274      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37244      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37880      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38230      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38118      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:37496      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:1099       172.25.30.21:47496      ESTABLISHED 0          42954824    4738/javatcp6       0      0 172.25.30.21:37474      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38200      172.25.30.12:5432       TIME_WAIT   0          0           -tcp6       0      0 172.25.30.21:38102      172.25.30.12:5432       TIME_WAIT   0          0           -PID greped outputveeru@localhost:~/veeru# netstat -tepn | grep 4738tcp6       0      0 127.0.1.1:41095         127.0.0.1:45180         ESTABLISHED 0          42960213    4738/java       tcp6       0      0 172.25.30.21:1099       172.25.30.21:49984      ESTABLISHED 0          42963153    4738/java 
How to get process(PID) initiated connections
linux;tcp