Created
October 10, 2025 15:47
-
-
Save jrelo/4cbf798b104ac337393b85b8e081f3bb to your computer and use it in GitHub Desktop.
netstat -s colors stat
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
| while true; do netstat -s | awk '/^[[:space:]]+[0-9]+/{num=$1; $1=""; desc=$0; print num"|"desc}' > /tmp/ns_new; if [ -f /tmp/ns_old ]; then clear; echo "=== Network Stats Delta ($(date +%T)) ==="; awk -F'|' 'NR==FNR{old[$2]=$1; next} {if(old[$2] && $1-old[$2]!=0) printf " \033[92m%+8d\033[0m %s\n", $1-old[$2], $2}' /tmp/ns_old /tmp/ns_new; fi; cp -f /tmp/ns_new /tmp/ns_old 2>/dev/null; sleep 1; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment