Show open network connections of a process

From AdminWiki

Revision as of 13:21, 8 May 2009 by Philip (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 4tcp@slashdot.org:80
lsof -i 6udp@ns1.sixxs.net:53
  • netstat:
netstat -tnap |grep <pid|processname>

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

Personal tools