# 查看所有的连接数
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
# 查看TCP连接数
netstat -n | grep ^tcp | awk '{++S[$NF]} END {for(a in S) print a, S[a]}'
status |
description |
CLOSED |
No connection is active or in progress |
LISTEN |
Server is waiting for an incoming call |
SYN_RECV |
A connection request has been reached, waiting for confirmation |
SYN_SENT |
Application has started, open a connection |
ESTABLISHED |
Normal data transmission state |
FIN_WAIT1 |
Said it has completed the application |
FIN_WAIT2 |
The other side has agreed to release |
ITMED_WAIT |
All packets waiting to die |
CLOSING |
Both sides at the same time try to shut down |
TIME_WAIT |
It represents processed, waits for the end of the timeout request number |
LAST_ACK |
All packets waiting to die |