Iftop stands for Interface Top. It is 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.
In this article, we are going to install the iftop on Ubuntu 20.04 and show it’s use cases with examples. You can install it on any other Linux-based system.
Install on Ubuntu 20.04
Install iftop with the following command for Ubuntu/Debian based:
$ sudo apt install -y iftop
Use cases of Iftop command:
After installing iftop, you can use it to check network bandwidth usage with the following commands. Basic syntax of iftop command is :
$ sudo iftop [option]
To check the total bandwidth usage
Check the total bandwidth of the default interface by simply using the command as shown below:
$ sudo iftop
To check the bandwidth usage of the specific interface
Check the bandwidth usage of the specific network interface with the following command:
$ sudo iftop -i [interface]
Here, we are checking for the specific wan interface:
To display the output in instinctive format
Display the output on clear and instinctive format, you can use the following command:
$ sudo iftop -t
To display the output of the bandwidth usage on Bytes
Display the total bandwidth usage of the specific interface or overall bandwidth status on Bytes with the following command:
$ sudo iftop -i enp1s0 -B
To display the output avoiding the hostname lookup
Display the bandwidth usage status without the hostname lookup using the following command:
$ sudo iftop -n -i enp1s0
To display the output sorting by source address
Display the output sorting as per source address with the following command:
$ sudo iftop -o source
To display the output sorting by destination address
Display the output sorting as per destination address with the following command:
$ sudo iftop -o destination
To display the output without bar graph
Display the output by removing the bar graph with the below command:
$ sudo iftop -b
To display the output with port numbers and hostnames
Display the output with the port numbers and hostnames by using the below command:
$ sudo iftop -P
To display and print the specific number of lines
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
With the iftop command, it will be very useful for all Linux users to monitor the overall or specific interface bandwidth usage. Try using the above commands and enhance the power as a Linux User. Thank you!
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.