Revision: 7771
Updated Code
at August 12, 2008 10:09 by scarfboy
Updated Code
netstat -nal |egrep '^tcp' | sed -r 's/[ ]+/ /g' | cut -d ' ' -f 1,6 | sort | uniq -c | sort -rn
Revision: 7770
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 12, 2008 10:08 by scarfboy
Initial Code
netstat -nal |egrep '^tcp' | \ sed -r 's/[ ]+/ /g' | cut -d ' ' -f 1,6 | sort | uniq -c | sort -rn
Initial URL
Initial Description
Filters for tcp and tcp6 lines, so omits udp and unix sockets. Information is gathered from /proc; this uses netstat mainly to format it. Gives output like:<tt><pre> 21 tcp LISTEN 12 tcp ESTABLISHED 7 tcp6 LISTEN 1 tcp TIME_WAIT</pre></tt>
Initial Title
Summarize TCP socket states (using netstat)
Initial Tags
Initial Language
Bash