Learn a Linux command every day (108): iptraf

Time:2021-9-21

Command introduction

Ptraf command is an IP LAN Monitor Based on ncurses. It generates various network statistics, including TCP information, UDP count, ICMP and OSPF information, Ethernet load information, node statistics, IP checksum error, etc.

[[email protected] ~]# iptraf
-bash: iptraf: command not found
[[email protected] ~]# yum install iptraf -y

Iptraf command is an interactive and colorful IP LAN monitoring tool. It can display the amount of data transferred between each connection and hosts.

In CentOS Linux, the version adopted is iptraf ng, a derivative of iptraf (there is no iptrsf command).

Learn a Linux command every day (108): iptraf

Syntax format

iptraf { [ -f ] [ -q ] [ { -i iface | -g | -d iface | -s iface | -z iface | -l iface } [ -t timeout ] [ -B [ -L logfile ] ] ] | [ -h ] }

Option description

-d   # Allows you to start details (Iface) on a specified interface immediately
-z   # Displays the packet count size on the specified interface
-i   # Start the IP traffic monitor on the specified interface immediately
-u   # Unsupported interfaces are allowed as Ethernet devices
-g   # Start general interface statistics now

Application examples

Let’s look at a moving picture first

Learn a Linux command every day (108): iptraf

Learn a Linux command every day (108): iptraf

Start details on the specified interface now

[[email protected] ~]# iptraf-ng -d ens33

Learn a Linux command every day (108): iptraf

View packet size

[[email protected] ~]# iptraf-ng -z ens33

Learn a Linux command every day (108): iptraf

The above are shown in the form of screenshots. In fact, they are dynamically updated in the actual use process.

Learn a Linux command every day (104): zcat

Learn a Linux command every day (105): TEE

Learn a Linux command every day (106): OpenSSL

Learn a Linux command every day (107): SAR