The iftop command listens to network traffic on a named network interface, or on the first interface, it can find which looks like an external interface if none is specified, and displays a table of current bandwidth usage by pairs of hosts. The iftop is a perfect tool for remote Linux server over an ssh based session.

iftop must be run by the root or the user who has sufficient permissions to monitor all network traffic on the network interface. See how to install iftop on CentOS/RHEL based server.


Type the command as per your Linux distro:

Install iftop on a Debian/Ubuntu Linux

Type the following apt-get command/apt command:
$ sudo apt-get install iftop

Install iftop on a CentOS/Fedora/RHEL/Scientific/Oracle Linux

Type the following yum command (first turn on EPEL repo):
$ sudo yum install iftop
Fedora Linux user type the following dnf command:
$ sudo dnf install iftop

Install iftop on Arch Linux

Type the following pacman command:
$ sudo pacman -S iftop

Install iftop on Alpine Linux

Type the following apk command:
# apk add iftop

Install iftop on Suse/OpenSuse Linux

Type the following zypper command:
# zypper install iftop

A note about installing iftop on Unix-like system

You can install iftop on Unix-like system such as FreeBSD, OpenBSD, MacOS and others too. This page only deals with Linux operating system. For example on FreeBSD one can install iftop using the following pkg command:
# pkg install iftop
On macOS Unix one can install it using the brew command. Hence, first install Homebrew on macOS and then type the following brew command:
$ brew install iftop


The syntax is:
iftop -i interface
iftop [options]

Type iftop command at the shell prompt to display traffic:
# iftop
Sample outputs:

Linux Display Bandwidth Usage on Network Interface using iftop command

iftop in action (click to enlarge image)

In this example, I am using eth0 interface:
# iftop -i eth0
Sample outputs:
Animated gif 01: iftop command in action

Animated gif 01: iftop command in action

However, iftop works best when you use filters. For example, if you want to find out how much bandwidth users are wasting or trying to figure out why the network is slow, run:
# iftop -f icmp
You can display or analyses packet flowing in and out of the network:
# iftop -F
Disable output for DNS traffic by using filter code such as:
# iftop -f 'not port domain'
iftop has many options read man page for further information see its man page – iftop(8)
See also:


And there you have it, you just learned how to display bandwidth usage on an interface by host. To get more info type the following man command or visit this page:
$ man iftop
$ iftop -h

iftop command options

Option Description
-h display this message
-n don’t do hostname lookups
-N don’t convert port numbers to services
-p run in promiscuous mode (show traffic between other hosts on the same network segment)
-b don’t display a bar graph of traffic
-B Display bandwidth in bytes
-i interface listen on named interface
-f filter code use filter code to select packets to count (default: none, but only IP packets are counted)
-F net/mask show traffic flows in/out of IPv4 network
-G net6/mask6 show traffic flows in/out of IPv6 network
-l display and count link-local IPv6 traffic (default: off)
-P show ports as well as hosts
-m limit sets the upper limit for the bandwidth scale
-c config file specifies an alternative configuration file
-t use text interface without ncurses
-o 2s Sort by first column (2s traffic average)
-o 10s Sort by second column (10s traffic average) [default]
-o 40s Sort by third column (40s traffic average)
-o source Sort by source address
-o destination Sort by destination address
-s num print one single text output afer num seconds, then quit
-L num number of lines to print

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 8 comments so far... add one
CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
8 comments… add one
  • Anonymous Sep 7, 2006 @ 13:11

    It is a very useful program. This commando shows I deal and the port of a single IP

    iftop -P -i any -F

  • Artem Nosulchik Oct 19, 2007 @ 11:32

    It’s also possible to apply filter when iftop is already running: just press “f” button and type filter you wish like:
    Net filter> host

  • ahmbay Aug 29, 2009 @ 9:36

    this is very usefull program. Thanks..

  • alfin Sep 10, 2009 @ 20:33

    thanks, its great
    but i still have one question, can iftop change source ip (ex: at picture above) to hostname from each pc that connected?


  • Penton Oct 14, 2009 @ 4:50

    marvellous! This application is so useful. I didn’t expect it be to user friendly. 🙂

  • blogger Feb 13, 2012 @ 1:44

    thanks, it works great with my wireless nic.

  • Pluto Apr 17, 2014 @ 4:49

    Something that works well via command line (especially for SSH) is iptraf. That lets you view stats with a wide variety of detail. Probably doesn’t work as well as this, but it works well enough 😉

  • Ismail May 7, 2017 @ 14:30

    Thanks iftop is really useful tool, but how you to make the opposite of this “iftop -F” i mean to exclude local bandwidth?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum