一,nethogs的作用:

按进程或程序实时统计网络带宽使用率

我们查看流量的占用时,知道来源的ip、访问的端口,还不足以帮我们确认到进程,

而nethogs则可以让我们查看每个进程所占用的流量带宽

说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest

对应的源码可以访问这里获取: https://github.com/liuhongdi/

说明:作者:刘宏缔 邮箱: 371125307@qq.com

二,安装nethogs:

[root@yjweb ~]# yum install nethogs 

说明:如果yum报错没有任何匹配,则先安装epel源

[root@localhost liuhongdi]# yum install epel-release

三,查看nethogs的版本

[root@yjweb ~]# nethogs -V
version 0.8.5

四,查看帮助

[root@yjweb ~]# nethogs -help
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

五,nethogs 的常用命令

1,每隔5秒刷新一次输出结果

[root@yjweb ~]# nethogs -d 5

说明:默认间隔是1秒

2,按发送的数据量倒排

[root@yjweb ~]# nethogs -s

说明:默认是按RECEIVE的数据量倒排

3,监控所有的网卡

[root@yjweb ~]# nethogs -a

4,监控指定的一个或多个网卡

[root@yjweb ~]# nethogs eth0 eth1

5,监测指定的次数

[root@yjweb ~]# nethogs eth0 -c 3

说明:次数更新完即退出

六,nethogs的交互指令

m : Cycle between display modes (kb/s, kb, b, mb) 切换网速显示单位
r : Sort by received. 按接收流量排序
s : Sort by sent. 按发送流量排序
q : Quit and return to the shell prompt. 退出NetHogs命令工具

七,查看当前的centos版本

[root@yjweb ~]# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)

最新文章

  1. 一、基于hadoop的nginx访问日志分析---解析日志篇
  2. assets 加载资源文件
  3. debian8 Apache 更改根目录
  4. Nancy 引用源码与NuGet安装差异
  5. js模拟类
  6. AI
  7. 受限玻尔兹曼机RBM—简易详解
  8. MVC小系列(一)【制作表格】
  9. Python学习 - 简单抓取页面
  10. SQL Server 中的嵌套事务与@@TranCount(转)
  11. MFC用GDI+动感歌词的制作
  12. java解析XML文件四种方法之引入源文件
  13. Javascrip动态添加样式,Dom操作,获取自定义属性
  14. python入门 -- 环境搭建(windows)
  15. 配置https and http2 local本地开发环境
  16. OWIN 自托管静态网站
  17. Apktool(3)——Apktool的使用
  18. Atitit 创业好处 Atitit 为什么我们要创业
  19. mysql和mariadb支持insert delayed的问题
  20. Golang匿名函数

热门文章

  1. 图解 Await 和 Async
  2. 《Java从入门到失业》第四章:类和对象(4.2):String类
  3. 《C++深度解析》课程目录
  4. [LeetCode]67. 二进制求和(字符串)(数学)
  5. 再学ajax--第二天 | 基于php+mysql+ajax的表单注册、登录、注销
  6. python-数据清洗与编码解码
  7. IPSecVPN介绍 & (Cisco Packet Tracer)IPSecVPN实验演示
  8. vue移动端记录列表滚动如何快速找到是哪个元素产生的滚动
  9. vue项目中视频播放结束返回首页出现1秒左右的白屏问题
  10. 解决SpringBoot项目创建缓慢问题