iftop

iftop shows ongoing bandwidth usage on the network interface

Installation

When iftop is not installed by default, it can be added to the system using the relevant software package.

Package information for iftop

Operating systemPackage nameInstallation
AlmaLinuxiftop
dnf install iftop
Arch Linuxiftop
pacman -S iftop
Debianiftop
apt install iftop
Fedoraiftop
dnf install iftop
Red Hat Enterprise Linuxiftop
dnf install iftop
Rocky Linuxiftop
dnf install iftop
Ubuntuiftop
apt install iftop

Your Linux distribution using a different package? Share your feedback.

Usage

Available options

OptionDescription
-hShow usage summary
-nNo lookup for hostnames
-NNo lookup for service names
-pPromiscuous mode to include traffic not going via the interface
-PShow port numbers
-lInclude traffic on link-local IPv6
-mSet upper limit for scale (with K/M/G suffix)
-BBandwidth in bytes/sec instead of bits/sec
-i IFACEDefine interface IFACE
-f FILTERDefine a filter with FILTER
-F NETMASKDefine the network mask filter using NETMASK (e.g. /24)
-G NETMASK6Define the IPv6 network mask filter using NETMASK6
-c FILEDefine configuration file using FILE
-tNo ncursus output, instead print to STDOUT

Missing an option in this overview? Share your feedback.

Shortcuts and keys

Key or key combinationAction
1Sort by first column
2Sort by second column
3Sort by third column
<Sort by source
>Sort by destination
bToggle bar display
dAggregate traffic by destination
fDefine filter code
h (or ?)Show help
jMove down, useful with 'o'
kMove up, useful with 'o'
lDefine POSIX extended regular expression to filter hostnames
nEnable or disable hostnames
oFreeze current screen order
pShow or hide ports
sAggregate traffic by source
tCycle through the display modes
BCycle through bar graph period (2/10/40 seconds)
DShow or hide destination port
LToggle between lineair or logarithimic scale
NEnable or disable service names for ports
PPause or unpause output
SShow or hide source port
TShow totals

Examples using iftop

Bandwidth usage

Show active connections and bandwidth usage

iftop

Filter connections

Only show connections originating from our system to a destination on port 80 (http)

iftop -f 'dst port 80'

Relevant articles using the iftop command

The following articles include an example on how to use iftop and might be worth further exploring.