Skip to content

Instantly share code, notes, and snippets.

@EsmailELBoBDev2
Created August 30, 2021 02:22
Show Gist options
  • Save EsmailELBoBDev2/74abc735321f338311c6124276cef1be to your computer and use it in GitHub Desktop.
Save EsmailELBoBDev2/74abc735321f338311c6124276cef1be to your computer and use it in GitHub Desktop.
bandwidth checker for linux - to test how much website is taking to load up
#!/bin/sh
init="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))"
printf "Recording bandwidth. press enter to stop."
read -r lol
fin="$(($(cat /sys/class/net/[ew]*/statistics/rx_bytes | paste -sd '+')))"
printf "%4sB of bandwidth used. \\n" $(numfmt --to=iec $(($fin-$init)))
@EsmailELBoBDev2
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment