Preview: Handy Netstat Commands
This is a preview, which will be updated as I collect a more comprehensive collection. Basically, I just want to publish this so I have it handy =P:
To get IPs grouped by number of connections :
netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
To get a summation of the various states of connections (HTTP specific):
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
To get a summation of the various states of connections (all):
netstat -tan | awk '{print $6}' | sort | uniq -c
Original authors: concorde, sailorFred, from http://www.webhostingtalk.com/archive/index.php/t-493735.html
[...] This post was Twitted by palero [...]