良许Linux教程网 干货合集 Linux常用命令—iftop命令

Linux常用命令—iftop命令

Linux常用命令iftop命令 是一款实时流量监控工具,监控TCP/IP连接等,缺点就是无报表功能。必须以root身份才能运行,下面良许教程网为大家分享一下Linux常用命令—iftop命令具体使用方法。

Linux常用命令—iftop命令

iftop

一款实时流量监控工具

语法

 iftop(选项)

选项

 iftop: display bandwidth usage on an interface by host
 
 Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
     [-F net/mask] [-G net6/mask6]
 
    -h                  display this message
    -n                  don't do hostname lookups
    -N                  don't convert port numbers to services
    -p                  run in promiscuous mode (show traffic between other
                        hosts on the same network segment)
    -b                  don't display a bar graph of traffic
    -B                  Display bandwidth in bytes
    -i interface        listen on named interface
    -f filter code      use filter code to select packets to count
                       (default: none, but only IP packets are counted)
    -F net/mask         show traffic flows in/out of IPv4 network
    -G net6/mask6       show traffic flows in/out of IPv6 network
    -l                  display and count link-local IPv6 traffic (default: off)
    -P                  show ports as well as hosts
    -m limit            sets the upper limit for the bandwidth scale
    -c config file      specifies an alternative configuration file
    -t                  use text interface without ncurses
   
    Sorting orders:
    -o 2s                Sort by first column (2s traffic average)
    -o 10s               Sort by second column (10s traffic average) [default]
    -o 40s               Sort by third column (40s traffic average)
    -o source            Sort by source address
    -o destination       Sort by destination address
   
    The following options are only available in combination with -t
    -s num              print one single text output afer num seconds, then quit
    -L num              number of lines to print

界面说明

第一行为带宽,这里为1Mbit,不是字节哦. 连接列表,最后三列分别是2秒,10秒和40秒的平均流量 => 代表发送   代表接收 最后三行表示发送,接收和全部的流量, 第二列为你运行iftop到目前流量,第三列为高峰值,第四列为平均值。

实例

 iftop           # 默认是监控第一块网卡的流量
 iftop -i eth1   # 监控eth1
 iftop -n        # 直接显示IP, 不进行DNS反解析
 iftop -N        # 直接显示连接埠编号, 不显示服务名称
 iftop -F 192.168.1.0/24 or 192.168.1.0/255.255.255.0  # 显示某个网段进出封包流量

总结

至此关于Linux常用命令iftop命令的使用方法分享结束,大家如果对iftop命令的使用方法还有问题可以通过评论区将问题提交我们。

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你!

137e00002230ad9f26e78-265x300

本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部