Show open network connections of a process

From AdminWiki

Jump to: navigation, search
  • lsof does not support selecting process and network, but you can do:
lsof -i |grep <pid|processname>

or a little bit faster:

lsof -Pnp <pid> |grep TCP
  • you can also select a certain socket type, address and port:
lsof -i
lsof -i
  • netstat:
netstat -tnap |grep <pid|processname>

Category:Lsof Category:Network Category:Shell Category:Snippet Category:Debugging Category:Netstat

Personal tools