Skip to content

Instantly share code, notes, and snippets.

@zaftzaft
Created May 29, 2018 11:48
Show Gist options
  • Save zaftzaft/e4da5a3cb30e3980896b213504121227 to your computer and use it in GitHub Desktop.
Save zaftzaft/e4da5a3cb30e3980896b213504121227 to your computer and use it in GitHub Desktop.
instant traffic monitor
#!/bin/bash
dev=$1
b=0
while :
do
a=`cat /proc/net/dev | grep $dev | sed "s/\s\{1,\}/ /g" | cut -d" " -f 11`
#echo $(($a-$b))
byte=`expr $a - $b`
echo `expr $byte \* 8`
b=$a
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment