Iftop stands for Interface Top which is derived from op command in Linux. It is basically a network monitoring tool that monitors and results in total bandwidth usage. It is useful for all system admin to monitor the network and bandwidth usage.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux system network analysis queries.
In this context, we shall look into how to install and use iftop on Ubuntu 20.04.
You can install iftop by running the below command:
$ sudo apt install -y iftop
The Basic syntax of iftop command is:
$ sudo iftop [option]
iftop can be used to check network bandwidth usage.
You can Check the total bandwidth of the default interface by simply using the below command:
$ sudo iftop
You can Check the bandwidth usage of the specific network interface with the following command:
$ sudo iftop -i [interface]
You can Display the output on clear and instinctive format by running the following command:
$ sudo iftop -t
You can Display the total bandwidth usage of the specific interface or overall bandwidth status on Bytes with the following command:
$ sudo iftop -i enp1s0 -B
You can Display the bandwidth usage status without the hostname lookup using the following command:
$ sudo iftop -n -i enp1s0
You can Display the output sorting as per source address with the following command:
$ sudo iftop -o source
You can Display the output sorting as per destination address with the following command:
$ sudo iftop -o destination
You can Display the output by removing the bar graph with the below command:
$ sudo iftop -b
You can Display the output with the port numbers and hostnames by using the below command:
$ sudo iftop -P
You can Display the output by providing the specific number so only such a number of lines can be printed out as output. Use the following command to print 4 lines as output for a specific interface:
$ sudo iftop -i enp1s0 -L 4
This article covers how to use IFTOP utility in Linux. In fact, iftop is a network analyzing tool used by system administrators to view the bandwidth related stats. It basically acts as a diagnostics to diagnose which program is causing the problem to the network.
How to Install iftop command on Linux system ?
1. For RedHat based Linux:
$ yum install epel-release
$ yum install iftop
2. For Debian or Ubuntu Linux:
$ sudo apt install iftop