Skip to content

Instantly share code, notes, and snippets.

@samvignoli
Created January 9, 2016 01:54
Show Gist options
  • Save samvignoli/0ba9d2030fced03d637c to your computer and use it in GitHub Desktop.
Save samvignoli/0ba9d2030fced03d637c to your computer and use it in GitHub Desktop.
bandwidth simples =)
while true; do cat /proc/net/dev; sleep 1; done | awk -v dc="date \"+%T\"" '/eth0/{i = $2 - oi; o = $10 - oo; oi = $2; oo = $10; dc|getline d; close(dc); if (a++) printf "%s %8.2f kbps in %8.2f kbps out\n", d, i/1000*8, o/1000*8}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment