Not quite a one-liner, but it can be copy&pasted in a terminal window π
bash TIME=10 FILE=file.log function fsize { SIZE=`ls -l $FILE | awk '{print $5}'` } fsize S1=$SIZE while true do sleep $TIME fsize S2=$SIZE (( DIFF=($S2-$S1)/$TIME )) echo "($S2-$S1)/$TIME = $DIFF" S1=$S2 done
The script above will check the “file.log” size every 10 seconds and output the previous size, the new size and bytes per second:
(30117062-30085517)/10 = 3154 (30148404-30117062)/10 = 3134 (30179199-30148404)/10 = 3079 ^C ^D