Search This Blog

2014-01-08

Sockets and Processes

Tracking down network activity usually comes down to figuring out what processes are bound to which socket.

In BSD the easiest way to do this is using sockstat
sockstat | grep 

In Linux the easiest way is generally netstat
netsat -pan | grep 

-p - program
-a - all show both listening and non-listening sockets
-n - numeric

References: http://stackoverflow.com/questions/1980355/linux-api-to-determine-sockets-owned-by-a-process

No comments:

Post a Comment