在 Ubuntu 系统中,ifconfig 命令主要用于查看和配置网络接口的参数,但它并不直接显示网络带宽的使用情况。如果你想查看网络带宽的使用情况,可以使用以下几种方法:
使用 ip 命令:
ip addr show
ip -s link
使用 nethogs 工具:
nethogs 是一个实时监控网络带宽使用情况的工具,可以按进程查看带宽使用。nethogs:sudo apt install nethogs
sudo nethogs eth0 # 将 eth0 替换为你的网络接口名称
使用 iftop 工具:
iftop 可以实时显示网络带宽的使用情况。iftop:sudo apt install iftop
iftop:sudo iftop -i eth0 # 将 eth0 替换为你的网络接口名称
使用 vnstat 工具:
vnstat 是一个网络流量监控工具,可以记录并报告网络接口的流量统计信息。vnstat:sudo apt install vnstat
vnstat 服务:sudo systemctl start vnstat
vnstat -i eth0 # 将 eth0 替换为你的网络接口名称
这些工具可以帮助你监控和分析网络带宽的使用情况。