Skip to content

nethogs - Per-Process Bandwidth Monitor Cheatsheet

nethogs - Per-Process Bandwidth Monitor Cheatsheet

nethogs is a small “net top” tool that groups bandwidth usage by process rather than by connection or subnet. When something is saturating your link, nethogs is the fastest way to see which program is responsible and how much it is sending and receiving — no packet filters or config required. It reads traffic per PID and needs root to do so.

Installation

PlatformCommand
Debian/Ubuntusudo apt install nethogs
Fedora/RHELsudo dnf install nethogs
Arch Linuxsudo pacman -S nethogs
macOS (Homebrew)brew install nethogs
Verifynethogs -V

Running

CommandDescription
sudo nethogsMonitor the default interface
sudo nethogs eth0Monitor a specific interface
sudo nethogs eth0 wlan0Monitor multiple interfaces
sudo nethogs -d 5Refresh every 5 seconds
sudo nethogs -v 3View mode: total accumulated traffic

The Display

ColumnMeaning
PIDProcess ID
USERProcess owner
PROGRAMExecutable path (and remote for some views)
DEVNetwork device
SENTUpload rate (KB/s by default)
RECEIVEDDownload rate

Interactive Keys

KeyAction
mCycle units (KB/s, KB, B, MB)
sSort by SENT
rSort by RECEIVED
qQuit

View Modes (-v)

ModeShows
-v 0KB/s (rate, default)
-v 1Total KB
-v 2Total B
-v 3Total MB (accumulated since start)

Options Worth Knowing

OptionDescription
-d SECONDSRefresh delay
-t”Trace” / non-interactive text output
-bBughunt mode (debug)
-aMonitor all devices (incl. loopback)
-pPromiscuous mode (see more traffic)
-CCapture in a limited/count mode

Common Workflows

# Find the bandwidth hog on your main interface, sorted by download
sudo nethogs eth0    # then press 'r' to sort by RECEIVED

# Monitor Wi-Fi with a slower refresh
sudo nethogs wlan0 -d 3

# Non-interactive capture for a script/ticket
sudo nethogs -t eth0 > nethogs.log
ToolGroups byNotes
nethogsProcess (PID)“Who is using bandwidth?“
iftopConnection (host pairs)“Which connections are busy?“
bandwhichProcess + connection + remoteRust, richest breakdown
nloadInterface totalsSimple aggregate graph

nethogs answers which process; iftop answers which connection; use them together when chasing a network problem.

Resources