In UNIX OS, how can I find the port number when i know the process name or pid ?
To answer the question directly: there is no connection between the process ID and the port number. They enumerate entirely different things. The PID identifies a process (eg a Firefox session: each tab may run as a different process), and the port number identifies which port that process is using to communicate.
netstat -pl | grep NAME_OR_PID
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With