Linux命令:
ss -ta | awk ‘!/State/ {++status[$1]} END{for(i in status) printf("%-15s %s\n",i,status[i])}‘
例子:
[root@localhost ]# ss -ta | awk ‘!/State/ {++status[$1]} END{for(i in status) printf("%-15s %s\n",i,status[i])}‘
LAST-ACK 1
ESTAB 57
FIN-WAIT-1 2
FIN-WAIT-2 5
TIME-WAIT 149
LISTEN 20
本文出自 “小莫” 博客,请务必保留此出处http://xiaofengmo.blog.51cto.com/10116365/1749570
原文:http://xiaofengmo.blog.51cto.com/10116365/1749570