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.
Instalación lista para agent
Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.
npx -y tokrepo@latest install 078ff42d-3859-11f1-9bc6-00163e2b0d79 --target codexEjecutar después de confirmar el plan con dry-run.
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
Preguntas frecuentes
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.
Referencias (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
Relacionados en TokRepo
Discusión
Activos relacionados
iperf3 — Network Bandwidth Measurement Tool
iperf3 is a cross-platform tool for measuring TCP, UDP, and SCTP network bandwidth performance between two endpoints, widely used for network testing and troubleshooting.
Pagefind — Static Low-Bandwidth Search for Any Website
A Rust-based static search library that indexes your site at build time and delivers instant search in the browser with minimal bandwidth.
Termshark — Terminal User Interface for Packet Analysis
Termshark is a terminal-based user interface for tshark that brings Wireshark-like packet inspection to the command line, ideal for analyzing network captures on remote servers.
Sampler — Real-Time Terminal Dashboards from Shell Commands
Sampler is a tool for shell commands execution, visualization, and alerting, turning any CLI output into live-updating terminal charts and gauges.