Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

bandwhich

> 开发工具
Open source

Terminal bandwidth utilization tool

11.9K stars0 likes1 views
WebsiteGitHub

About

Terminal bandwidth utilization tool

bandwhich

This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname

Table of contents

  • bandwhich
    • Table of contents
    • Project status
    • How does it work?
    • Installation
      • Downstream packaging status
      • Download a prebuilt binary
    • Building from source
      • Cross-compiling
        • Android
    • Post install (Linux)
      • 1. setcap
        • Capabilities explained
      • 2. sudo (or alternative)
    • Post install (Windows)
    • Usage
    • Contributing
    • License

Project status

This project is in passive maintenance. Critical issues will be addressed, but no new features are being worked on. However, this is due to a lack of funding and/or manpower more than anything else, so pull requests are more than welcome. In addition, if you are able and willing to contribute to this project long-term, we would like to invite you to apply for co-maintainership.

For more details, see The Future of Bandwhich #275.

How does it work?

bandwhich sniffs a given network interface and records IP packet size, cross referencing it with the /proc filesystem on linux, lsof on macOS, or using WinApi on windows. It is responsive to the terminal window size, displaying less info if there is no room for it. It will also attempt to resolve ips to their host name in the background using reverse DNS on a best effort basis.

Installation

Downstream packaging status

For detailed instructions for each platform, see INSTALL.md.

Download a prebuilt binary

We offer several generic binaries in releases for various OSes.

OSArchitectureSupportUsage
Androidaarch64Best effort

All modern Android devices.

Note that this is a pure binary file, not an APK suitable for general usage.

Linuxaarch64Full 64-bit ARMv8+ (servers, some modern routers, RPi-4+).
armv7hfBest effort32-bit ARMv7 (older routers, pre-RPi-4).
x64Full Most Linux desktops & servers.
MacOSaarch64Full Apple silicon Macs (2021+).
x64 Intel Macs (pre-2021).
Windowsx64Full Most Windows desktops & servers.

Building from source

bash
git clone https://github.com/imsnif/bandwhich.git
cd bandwhich
cargo build --release

For the up-to-date minimum supported Rust version, please refer to the rust-version field in Cargo.toml.

Cross-compiling

Cross-compiling for alternate targets is supported via cross. Here's the rough procedure:

  1. Check the target architecture. If on Linux, you can use uname -m.
  2. Lookup rustc platform support for the corresponding target triple.
  3. Install cross.
  4. Run cross build --release --target <TARGET_TRIPLE>.

Android

Until cross-rs/cross#1222 is solved, use the latest HEAD:

bash
cargo install --git https://github.com/cross-rs/cross.git cross
cross build --release --target aarch64-linux-android

Post install (Linux)

Since bandwhich sniffs network packets, it requires elevated privileges. On Linux, there are two main ways to accomplish this:

1. setcap

  • Permanently allow the bandwhich binary its required privileges (called "capabilities" in Linux).
  • Do this if you want to give all unprivileged users full access to bandwhich's monitoring capabilities.
    • This is the recommended setup for single user machines, or if all users are trusted.
    • This is not recommended if you want to ensure users cannot see others' traffic.
bash
# assign capabilities
sudo setcap cap_sys_ptrace,cap_dac_read_search,cap_net_raw,cap_net_admin+ep $(command -v bandwhich)
# run as unprivileged user
bandwhich

Capabilities explained

  • cap_sys_ptrace,cap_dac_read_search: allow access to /proc/<pid>/fd/, so that bandwhich can determine which open port belongs to which process.
  • cap_net_raw,cap_net_admin: allow capturing packets on your system.

2. sudo (or alternative)

  • Require privilege escalation every time.
  • Do this if you are an administrator of a multi-user environment.
bash
sudo bandwhich

Note that if your installation method installed bandwhich to somewhere in your home directory (you can check with command -v bandwhich), you may get a command not found error. This is because in many distributions, sudo by default does not keep your user's $PATH for safety concerns.

To overcome this, you can do any one of the following:

  1. make sudo preserve your $PATH environment variable;
  2. explicitly set $PATH while running bandwhich: sudo env "PATH=$PATH" bandwhich;
  3. pass the full path to sudo: sudo $(command -v bandwhich).

Post install (Windows)

You might need to first install npcap for capturing packets on Windows.

Usage

…

Contributing

See CONTRIBUTING.md.

License

MIT

Issues· 55 open

View all issuesOpen on GitHub
  • #196

    Electron processes shown as UNKNOWN

    bughelp wantedUpdated Sep 8, 2026
  • #513

    Can't scroll up and down

    Updated Jun 12, 2026
  • #123

    Feature: dump current state to logfile

    enhancementhelp wantedUpdated May 20, 2026
  • #466

    Can you create a Prometheus exporter so I can write data to the Prometheus database?

    enhancementhelp wantedUpdated Apr 7, 2026
  • #482

    --log-conn-to option

    Updated Dec 18, 2025
  • #481

    --no-localhost option

    Updated Dec 18, 2025
  • #480

    ip geolocation

    Updated Dec 18, 2025
  • #449

    Amount of traffic reported is incorrect (much lower than real)

    bugUpdated Mar 3, 2025
  • #447

    Traffic misidentification on routing host

    bughelp wantedUpdated Dec 6, 2024
  • #446

    Resolve NAT mappings

    enhancementdiscussionUpdated Dec 6, 2024

> Tags

Rustbandwidthclidashboardnetworking

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具