Nasser Heidari

2010-04-22

Socket state counter

Filed under: Linux — Nasser Heidari @ 16:10

# netstat -an | awk '/^tcp/ {A[$(NF)]++} END {for (I in A) {printf "%5d %s\n", A[I], I}}'

1 LAST_ACK
16 LISTEN
2 SYN_RECV
5 CLOSE_WAIT
26 ESTABLISHED
1 FIN_WAIT1
2 SYN_SENT
4 CLOSING
18 TIME_WAIT

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: