Linux iftop命令查看上传下载速率

本文介绍了在Ubuntu18.04.2LTS系统中如何安装流量监控工具iftop,以及如何使用它来查看网络接口的实时流量。通过-i参数指定接口,-B参数以字节为单位显示流量,并提供了wget下载大文件以测试监控效果的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

以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 的平均流量

更多参考:

https://blog.csdn.net/guotianqing/article/details/109822561

https://www.vpser.net/manage/iftop.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值