nethogs Linux 进程网络带宽监控统计工具

发布时间: 更新时间: 总字数:328 阅读时间:1m 作者: IP上海 分享 网址

NetHogs是一个Linux命令行工具,实现按进程实时统计网络带宽

介绍

NetHogs 是一款小型的 net top 工具。它不像大多数工具那样按协议或子网细分流量,而是按进程分组带宽。

安装

Ubuntu

apt install nethogs

Redhat

yum install nethogs

使用

Help

nethogs -h ...
$ nethogs -h
usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]]
		-V : prints version.
		-h : prints this help.
		-b : bughunt mode - implies tracemode.
		-d : delay for update refresh rate in seconds. default is 1.
		-v : view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB). default is 0.
		-c : number of updates. default is 0 (unlimited).
		-t : tracemode.
		-p : sniff in promiscious mode (not recommended).
		-s : sort output by sent column.
   -a : monitor all devices, even loopback/stopped ones.
		device : device(s) to monitor. default is all interfaces up and running excluding loopback

When nethogs is running, press:
 q: quit
 s: sort by SENT traffic
 r: sort by RECEIVE traffic
 m: switch between total (KB, B, MB) and KB/s mode

运行时,快捷键调整显示情况:

  • s:按 SENT 流量排序
  • r:按 RECEIVE 流量排序
  • m:在总(KB,B,MB)和 KB/s 模式之间切换
  • q:退出命令提示符

示例

$ nethogs

# 监听指定网卡
$ nethogs eth0

# 每5秒刷新一次
$ nethogs -d 5

参考

  1. https://github.com/raboof/nethogs
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数