4. 查看tcp各个连接状态的数量下面对的netstat -tan|awk '$1~/tcp/{aa[$NF]++}END{for (h in aa)print h,aa[h]}'SYN_SENT 1ESTABLISHED 3LISTEN 15netstat -tan|awk '$1~/tcp/{print $NF}'|sort|uniq -c|sort -nr15 LISTEN3 ESTABLISHED1 SYN_SENT
统计8080端口上有多少个TCP连接,命令:
netstat –tan | grep 8080 | wc –l TCP连接中有多少个连接状态是ESTABLISHED,命令:
netstat –tan | grep 8080 | grep ESTABLISHED| wc -l TCP连接中有多少个连接状态是CLOSE_WAIT
netstat –tan | grep 8080 | grep CLOSE_WAIT| wc -l TCP连接中有多少个连接状态是TIME_WAIT
netstat –tan | grep 8080 | grep TIME_WAIT| wc -l