Last active
September 27, 2020 17:35
-
-
Save schneefisch/ff3552dde57772a2523d7a72fd7a8825 to your computer and use it in GitHub Desktop.
basics for netstat
This file contains hidden or 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
# check active connections | |
netstat -ant | grep 4444 | wc -l | |
# only established connections | |
netstat -ant | grep 4444 | grep -i established | wc -l | |
# idle connections | |
netstat -an -f inet | grep -v EST | grep IDLE | wc -l | |
# in loop | |
while true; do clear; netstat -an -f inet | awk '{print $2}' | cut -d. -f1-4 | sort | uniq -c | sort -n | grep -v "*.*" | tail -10; sleep 5; done | |
# show overall open connections on the server | |
while true; do clear; netstat -an -f inet | awk '{print $2}' | cut -d. -f1-4 | wc -l; sleep 5; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment