Linux iftop命令查看上传下载速率
以Ubuntu 18.04.2 LTS为例
1.安装iftop
sudo apt-get install iftop
2.启动程序,也可以使用-i指定接口
若无流量,可以使用wget下载一个文件配合测速,文件大小127M,-O指定下载路径,ubuntu里的wget本身就可以看到下载速率。
wget https://mirrors.tuna.tsinghua.edu.cn/kernel/v6.x/linux-6.0.1.tar.xz -O /tmp/tmp.iso
wget http://mirrors.tuna.tsinghua.edu.cn/kernel/v6.x/linux-6.0.1.tar.xz -O /tmp/tmp.iso
937M测试文件: https://mirrors.tuna.tsinghua.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
http://mirrors.tuna.tsinghua.edu.cn/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
sudo iftop
3.查看接口实时流量
-B 指定显示单位为bytes,默认是bit
-i interface 指定接口
iftop -h查看帮助
TX:发送流量
RX:接收流量
TOTAL:总流量
Cumm:运行iftop到目前时间的总流量
peak:流量峰值
rates:分别表示过去 2s 10s 40s 的平均流量
更多参考: