Windows:
In this example you can see the One Drive is using port 443.
C:\>netstat -aon | findstr "443" TCP 192.168.1.40:7443 52.173.26.181:443 ESTABLISHED 10252
C:\>tasklist | findstr /c:"10252" OneDrive.exe 10252 Console 1 37,240 K
Use the “/V” parameter to get the user info.
MacOS/Unix/Linux:
In this example you can see the Java is using port 636.
root kc-hpux:/ # lsof -i tcp:636 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 25697 root 323u IPv4 0xe000000711c43d00 0t572 TCP dclwprd1:55776->dc1.cordero.me:636 (ESTABLISHED) java 25697 root 324u IPv4 0xe0000006ef12f080 0t0 TCP dclwprd1:55777->dc2.cordero.me:636 (SYN_SENT)
If you want to see just all the ESTABLISHED connection for a given port:
C:\>netstat -aon | findstr "443" | findstr "ESTABLISHED" TCP 192.168.1.40:1062 104.26.8.142:443 ESTABLISHED 7492 TCP 192.168.1.40:1086 192.168.10.222:443 ESTABLISHED 7492 TCP 192.168.1.40:1105 40.97.190.18:443 ESTABLISHED 12928 TCP 192.168.1.40:1110 40.97.190.18:443 ESTABLISHED 12928