Linux – How to find ports opened by process ID in Linux


Suppose the PID of the process is already known

Best Solution

netstat --all --program | grep '3265'
  • --all show listening and non-listening sockets.
  • --program show the PID and name of the program to which socket belongs.

You could also use a port scanner such as Nmap.