linux:查看网卡的发送接收数据量统计
一,使用ip命令:
命令: ip -s link
-s[tatistics] : 统计
[root@web mysql]# ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
RX: bytes packets errors dropped missed mcast
5119067602 4317489 0 0 0 0
TX: bytes packets errors dropped carrier collsns
5119067602 4317489 0 0 0 0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
link/ether ...
RX: bytes packets errors dropped missed mcast
7914191224 12011379 0 0 0 0
TX: bytes packets errors dropped carrier collsns
4243490577 8626349 0 0 0 0
altname enp0s6
altname ens6
说明:
TX
:发送流量RX
:接收流量
二,使用ifconfig命令:
[root@web mysql]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet ...
inet6 ...
ether ...
RX packets 12013047 bytes 7914402135 (7.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8627500 bytes 4244454580 (3.9 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 4318063 bytes 5119407050 (4.7 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4318063 bytes 5119407050 (4.7 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
说明:ifconfig命令已经不被某些发行版内置安装,例如ubuntu 21.10,建议大家优先使用ip命令:
liuhongdi@lhdpc:/api$ ifconfig
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools
三,查看实时的流量:
nload: 统计网卡上的流入和流出数量
可以统计到网卡
iftop: 统计各客户端到服务器的流量,
可以统计到ip
nethogs: 统计到各进程的流量
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
2021-09-28 vue.js 3.0.5:用vue-i18n开发i18n国际化功能(vue-i18n@9.2.0)