bandwhich — Terminal Bandwidth Utilization by Process and Connection
bandwhich is a CLI tool that shows which process, connection, or remote host is using your bandwidth in real time. Finally answer "what is eating my network?" without opening Wireshark.
What it is
bandwhich is a CLI tool that answers the question: which process is using my network right now. It displays real-time bandwidth utilization broken down by process, connection, and remote host. Think of it as a lightweight, terminal-native alternative to opening Wireshark just to find out what is hogging your connection.
bandwhich targets developers, sysadmins, and anyone troubleshooting unexpected network usage on Linux or macOS.
How it saves time or tokens
Without bandwhich, diagnosing bandwidth issues requires combining nethogs, iftop, and lsof output. bandwhich shows all three views (process, connection, remote host) in a single TUI. One command replaces a multi-tool debugging session.
For AI agents managing infrastructure, bandwhich output can be piped or parsed to identify runaway processes automatically.
How to use
- Install via package manager:
brew install bandwhich(macOS) orsudo apt install bandwhich(Debian) - Run with sudo for process resolution:
sudo bandwhich - Press
tabto switch between process, connection, and remote host views - Press
qto quit
Example
# Install on macOS
brew install bandwhich
# Run with elevated privileges for process name resolution
sudo bandwhich
# Output shows something like:
# Process Upload Download
# firefox 12 KB/s 1.2 MB/s
# docker 340 B/s 15 KB/s
# slack 1.1 KB/s 800 B/s
# Filter by network interface
sudo bandwhich -i en0
# Raw mode for scripting
sudo bandwhich --raw
Related on TokRepo
- Monitoring tools -- Network and system monitoring tools
- DevOps tools -- Infrastructure management and debugging
Common pitfalls
- bandwhich requires root/sudo to resolve process names; without it you only see connections without process attribution
- On macOS, you may need to grant Full Disk Access or use
sudoexplicitly for the binary - bandwhich captures live traffic only; it does not store historical data or produce reports for later analysis
Frequently Asked Questions
It runs without sudo but cannot resolve which process owns each connection. You see bandwidth by connection and remote host, but the process column is empty. For full functionality, run with sudo.
nethogs shows per-process bandwidth but not per-connection or per-remote-host breakdowns. bandwhich provides all three views in a single tool. bandwhich is written in Rust and generally uses less CPU than nethogs.
Yes. Use the -i flag followed by the interface name, such as 'sudo bandwhich -i eth0'. This filters traffic to only that interface, useful on machines with multiple network connections.
bandwhich has experimental Windows support but it is less mature than Linux and macOS. Process resolution on Windows may not work correctly. For Windows, consider using Resource Monitor or Glasswire instead.
Use the --raw flag to output machine-readable data. You can pipe this to a file or processing script. The raw output includes timestamps, process names, and byte counts suitable for log analysis.
Citations (3)
- bandwhich GitHub— bandwhich displays bandwidth utilization by process, connection, and remote host
- bandwhich README— Rust-based CLI tool for real-time network monitoring
- nethogs GitHub— nethogs is a per-process network bandwidth monitor
Related on TokRepo
Discussion
Related Assets
Cucumber.js — BDD Testing with Plain Language Scenarios
Cucumber.js is a JavaScript implementation of Cucumber that runs automated tests written in Gherkin plain language.
WireMock — Flexible API Mocking for Java and Beyond
WireMock is an HTTP mock server for stubbing and verifying API calls in integration tests and development.
Google Benchmark — Microbenchmark Library for C++
Google Benchmark is a library for measuring and reporting the performance of C++ code with statistical rigor.