在eth0上,使用awk,cut,echo,grep,ifconfig和sleep测量下载速度
Hujiuxiang
・1 分钟阅读
在eth0上测量下载速度
while true; do X=$Y; sleep 1; Y=$(ifconfig eth0|grep RX bytes|awk '{ print $2 }'|cut -d : -f 2); echo"$(( Y-X )) bps"; done