Skip to content

Instantly share code, notes, and snippets.

@mkyung
Created June 14, 2016 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkyung/43d19b67386e490ddce31b0d3a797889 to your computer and use it in GitHub Desktop.
Save mkyung/43d19b67386e490ddce31b0d3a797889 to your computer and use it in GitHub Desktop.
Linux TCP connection stats
netstat -tn | awk '/^tcp/ {t[$NF]++}END{for(state in t){print state, t[state]} }'
# Results:
# LAST_ACK 1
# ESTABLISHED 4
# FIN_WAIT1 9
# TIME_WAIT 9
# SYN_SENT 500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment