在 Linux 里,ifconfig 能看到部分流量统计信息,但功能有限。
执行:
ifconfig eth0
(把 eth0 换成你的网卡名,如 ens33、wlan0)
你会看到类似:
RX packets 123456 bytes 98765432 (94.1 MiB)
TX packets 654321 bytes 12345678 (11.7 MiB)
含义:
packets:包数量bytes:总字节数(从系统启动或网卡 up 以来累计)⚠️ 注意:
ip 命令(新系统推荐)ip -s link
sar(非常专业)sar -n DEV 1
iftop(实时看谁在占用)iftop -i eth0
nload(简单直观)nload
✅ ifconfig 能看流量(累计)
❌ 不能看实时速率
✅ 想看实时流量,用 iftop / nload / sar
如果你是想:
可以告诉我使用场景,我给你具体命令。