Monday, August 3, 2015

What processes on my machine are connected to the internet?

This is a one-liner that will tell you which processes on your host (mines a mac) that are connected to which ips by port.

for i in `netstat -aln |grep ESTABLISHED|sed 's/\ \ */,/g' |cut -d, -f5|cut -d. -f5|sort -u`;do lsof -i :$i ;done

No comments :

Post a Comment