用 nettop 查看每个程序的网络流量
实时查看每个进程的收发流量,找出偷跑流量的应用。
运行 `nettop -P -l 1` 即可按进程打印一次流量快照。
01命令
命令
$ nettop -P -l 102作用说明
当风扇狂转或套餐流量异常消耗时,nettop 能把流量归到具体进程——比活动监视器的网络标签页更直观。-P 表示按进程汇总,-l 1 表示只采样一次;直接运行 `nettop -P` 则进入实时滚动模式。bytes_in/bytes_out 列是进程启动以来的累计流量。
03风险
!注意: 累计值不代表当前速度:对同一进程间隔几秒采样两次,用差值才能算出实时速率。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- nettop(1) — display network activity by process依据: Documents nettop -P aggregating traffic per process and -l 1 taking a single sample instead of an animated display.
最后验证: 2026-09-18 · 分类: 开发者