Skip to content

Commit

Permalink
add tcp-connection-state-counter.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Mar 14, 2014
1 parent e41ec4e commit 0546f09
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tcp-connection-state-counter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# @Function
# show count of tcp connection stat.
#
# @Usage
# $ ./tcp-connection-state-counter.sh
#
# @author Jerry Lee

netstat -tn | awk 'NR > 2 {
s[$NF]++
}
END {
for(v in s) {
print v "\t" s[v]
}
}' | sort -nr -k2,2

0 comments on commit 0546f09

Please sign in to comment.