Process port-protocol form PID

1

If I have process ID and I want to know the port and Protocol of this process is there any command in netstat or other help me?

dana.ba

Posted 2014-09-03T08:22:52.480

Reputation: 43

Answers

0

netstat -aon will give you a list of open ports and what process (PID) has them open. You could then pipe the result to the find command to only list ports open with a specific PID.

For Example:

I want to see what ports process 820 has open

netstat -aon | find "820"

This will provide some false positives if there is a port number or process name that also contains the number 820.

Joe

Posted 2014-09-03T08:22:52.480

Reputation: 1