Created
October 20, 2023 18:34
-
-
Save ElijahLynn/a77b16d476a4e0303e6be26fc97c89dd to your computer and use it in GitHub Desktop.
Show all TCP connections and states (1 liner)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch -n 1 "netstat -an | awk '/^tcp/ { ++S[\$NF] } END { for(a in S) print a, S[a] }'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LISTEN 10 | |
FIN_WAIT_1 253 | |
SYN_SENT 2368 | |
CLOSING 152 | |
CLOSE_WAIT 2 | |
CLOSED 27 | |
ESTABLISHED 2282 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment