getBytes() { cat /proc/net/dev | grep $1 | egrep -o "[0-9]{2,}" | head -n1 ; } getTp() { B=$(getBytes $1) ; sleep 1 ; A=$(getBytes $1) ; echo $(( $A - $B )) bytes/s ; } getTp eth0