×


iftop Command in Ubuntu Linux system - With Examples ?

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.


How to install on Ubuntu ?

You can install iftop by running the below command:

$ sudo apt install -y iftop


What is the syntax of Iftop command ?

The Basic syntax of iftop command is:

$ sudo iftop [option]

iftop can be used to check network bandwidth usage.


How to check the total bandwidth usage ?

You can Check the total bandwidth of the default interface by simply using the below command:

$ sudo iftop


How to check the bandwidth usage of the specific interface ?

You can Check the bandwidth usage of the specific network interface with the following command:

$ sudo iftop -i [interface]


How to display the output in instinctive format ?

You can Display the output on clear and instinctive format by running the following command:

$ sudo iftop -t


How to display the output of the bandwidth usage on Bytes ?

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


How to display the output avoiding the hostname lookup ?

You can Display the bandwidth usage status without the hostname lookup using the following command:

$ sudo iftop -n -i enp1s0


How to display the output sorting by source address ?

You can Display the output sorting as per source address with the following command:

$ sudo iftop -o source


How to display the output sorting by destination address ?

You can Display the output sorting as per destination address with the following command:

$ sudo iftop -o destination


How to display the output without bar graph ?

You can Display the output by removing the bar graph with the below command:

$ sudo iftop -b


How to display the output with port numbers and hostnames ?

You can Display the output with the port numbers and hostnames by using the below command:

$ sudo iftop -P


How to display and print the specific number of lines ?

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


[Need assistance in fixing Linux system issues? We can help you. ]


Conclusion

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