View the tcp connection status and connection statistics in the linux system

[root@localhost ~]# netstat -an | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

LISTEN 13
CLOSE_WAIT 936
ESTABLISHED 4
TIME_WAIT 2

Guess you like

Origin blog.csdn.net/u014108439/article/details/89313569