iftop command in Linux with Examples

iftop is a network analyzing tool used by system administrators to view the bandwidth related stats. It shows a quick overview of the networking activities on an interface. It stands from Interface TOP and the top is derived from op command in Linux. It even acts as a diagnostics to diagnose which program is causing the problem to the network.

Installing iftop command

For RedHat based Linux

yum install epel-release
yum install  iftop

For Debian or Ubuntu Linux

sudo apt install iftop

Working with iftop Command

1. To display basic bandwidth usage of the default interface.

iftop

1-To-display-basic-bandwidth-usage-of-the-default-interface



This command will now display all the bandwidth related stats of the default interface.

2. To display bandwidth details of a specific router

sudo iftop -i wlo1

2-To-display-bandwidth-details-of-a-specific-router

This command will now display all the bandwidth related stats of the specified network interface which is wlo1.

3. To stop hostname lookup

sudo iftop -n -i wlo1

3-To-stop-hostname-lookup

This command will now stop the lookup of the hostname for the specified network interface which is wlo1.

4. To stop the conversion of port number to services.



sudo iftop -N -i wlo1

4-To-stop-the-conversion-of-port-number-to-services

This command will not convert the port number to services while printing stats for the specified network interface which is wlo1.

5. To stop the display of bar graph.

sudo iftop -b

5-To-stop-the-display-of-bar-graoh

This command will remove the bar graph of traffic from the output.

6. To display the text interface without ncurses

sudo iftop -t

6-To-display-the-text-interface-without-ncurses

This command will display the output in the text interface without ncurses.

7. To sort output by source address

sudo iftop -o source 

7-To-sort-output-by-source-address



This command will sort the output on the basis of the source address.

8. To sort output by destination address

sudo iftop -o destination

8-To-sort-output-by-destination-address

This command will sort the output on the basis of the destination address.

9. To specify number of lines to be printed

sudo iftop -L 2 -i wlo1

9-To-specify-number-of-lines-to-be-printed

This command will print 2 output lines of statistics or bandwidth usage and not more than 2 lines would be printed.

10. To display help

sudo iftop -h

10-To-display-help

This command will display the help section of the iftop command.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.