{"id":13395180,"url":"https://github.com/imsnif/bandwhich","last_synced_at":"2025-05-14T21:02:00.853Z","repository":{"id":38326082,"uuid":"206874323","full_name":"imsnif/bandwhich","owner":"imsnif","description":"Terminal bandwidth utilization tool","archived":false,"fork":false,"pushed_at":"2025-05-01T01:45:58.000Z","size":5601,"stargazers_count":10478,"open_issues_count":35,"forks_count":304,"subscribers_count":74,"default_branch":"main","last_synced_at":"2025-05-07T19:47:41.700Z","etag":null,"topics":["bandwidth","cli","dashboard","networking"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imsnif.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["imsnif"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2019-09-06T21:08:33.000Z","updated_at":"2025-05-07T12:32:44.000Z","dependencies_parsed_at":"2023-07-14T07:21:28.864Z","dependency_job_id":"5a792248-ff3e-49ea-a99d-4afcd6bd05a0","html_url":"https://github.com/imsnif/bandwhich","commit_stats":{"total_commits":345,"total_committers":38,"mean_commits":9.078947368421053,"dds":"0.37681159420289856","last_synced_commit":"45503a01a687208cdc61be3fda25b1603d008653"},"previous_names":["imsnif/what"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsnif%2Fbandwhich","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsnif%2Fbandwhich/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsnif%2Fbandwhich/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsnif%2Fbandwhich/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imsnif","download_url":"https://codeload.github.com/imsnif/bandwhich/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253377209,"owners_count":21898935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bandwidth","cli","dashboard","networking"],"created_at":"2024-07-30T17:01:45.284Z","updated_at":"2025-05-14T21:02:00.723Z","avatar_url":"https://github.com/imsnif.png","language":"Rust","readme":"# bandwhich\n\n![demo](res/demo.gif)\n\nThis is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname\n\n## Table of contents\n\n- [bandwhich](#bandwhich)\n  - [Table of contents](#table-of-contents)\n  - [Project status](#project-status)\n  - [How does it work?](#how-does-it-work)\n  - [Installation](#installation)\n    - [Downstream packaging status](#downstream-packaging-status)\n    - [Download a prebuilt binary](#download-a-prebuilt-binary)\n  - [Building from source](#building-from-source)\n    - [Cross-compiling](#cross-compiling)\n      - [Android](#android)\n  - [Post install (Linux)](#post-install-linux)\n    - [1. `setcap`](#1-setcap)\n      - [Capabilities explained](#capabilities-explained)\n    - [2. `sudo` (or alternative)](#2-sudo-or-alternative)\n  - [Post install (Windows)](#post-install-windows)\n  - [Usage](#usage)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Project status\n\nThis project is in passive maintenance. Critical issues will be addressed, but\nno new features are being worked on. However, this is due to a lack of funding\nand/or manpower more than anything else, so pull requests are more than welcome.\nIn addition, if you are able and willing to contribute to this project long-term,\nwe would like to invite you to apply for co-maintainership.\n\nFor more details, see [The Future of Bandwhich #275](https://github.com/imsnif/bandwhich/issues/275).\n\n## How does it work?\n\n`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.\n\n## Installation\n\n### Downstream packaging status\n\nFor detailed instructions for each platform, see [INSTALL.md](INSTALL.md).\n\n\u003ca href=\"https://repology.org/project/bandwhich/versions\"\u003e\n  \u003cimg src=\"https://repology.org/badge/vertical-allrepos/bandwhich.svg?columns=3\" alt=\"Packaging status\"\u003e\n\u003c/a\u003e\n\n### Download a prebuilt binary\n\nWe offer several generic binaries in [releases](https://github.com/imsnif/bandwhich/releases) for various OSes.\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003cth\u003eOS\u003c/th\u003e\u003cth\u003eArchitecture\u003c/th\u003e\u003cth\u003eSupport\u003c/th\u003e\u003cth\u003eUsage\u003c/th\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eAndroid\u003c/td\u003e\u003ctd\u003eaarch64\u003c/td\u003e\u003ctd\u003eBest effort\u003c/td\u003e\n      \u003ctd\u003e\n        \u003cp\u003eAll modern Android devices.\u003c/p\u003e\n        \u003cp\u003eNote that this is a pure binary file, not an APK suitable for general usage.\u003c/p\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=\"3\"\u003eLinux\u003c/td\u003e\u003ctd\u003eaarch64\u003c/td\u003e\u003ctd\u003eFull\u003c/td\u003e\n      \u003ctd\u003e64-bit ARMv8+ (servers, some modern routers, RPi-4+).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003earmv7hf\u003c/td\u003e\u003ctd\u003eBest effort\u003c/td\u003e\u003ctd\u003e32-bit ARMv7 (older routers, pre-RPi-4).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ex64\u003c/td\u003e\u003ctd\u003eFull\u003c/td\u003e\n      \u003ctd\u003eMost Linux desktops \u0026 servers.\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd rowspan=\"2\"\u003eMacOS\u003c/td\u003e\u003ctd\u003eaarch64\u003c/td\u003e\u003ctd rowspan=\"2\"\u003eFull\u003c/td\u003e\n      \u003ctd\u003eApple silicon Macs (2021+).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003ex64\u003c/td\u003e\n      \u003ctd\u003eIntel Macs (pre-2021).\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003eWindows\u003c/td\u003e\u003ctd\u003ex64\u003c/td\u003e\u003ctd\u003eFull\u003c/td\u003e\n      \u003ctd\u003eMost Windows desktops \u0026 servers.\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Building from source\n\n```sh\ngit clone https://github.com/imsnif/bandwhich.git\ncd bandwhich\ncargo build --release\n```\n\nFor the up-to-date minimum supported Rust version, please refer to the `rust-version` field in [Cargo.toml](Cargo.toml).\n\n### Cross-compiling\n\nCross-compiling for alternate targets is supported via [cross](https://github.com/cross-rs/cross). Here's the rough procedure:\n\n1. Check the target architecture. If on Linux, you can use `uname -m`.\n2. Lookup [rustc platform support](https://doc.rust-lang.org/rustc/platform-support.html) for the corresponding target triple.\n3. [Install `cross`](https://github.com/cross-rs/cross#installation).\n4. Run `cross build --release --target \u003cTARGET_TRIPLE\u003e`.\n\n#### Android\n\nUntil [cross-rs/cross#1222](https://github.com/cross-rs/cross/issues/1222) is solved, use the latest HEAD:\n\n```sh\ncargo install --git https://github.com/cross-rs/cross.git cross\ncross build --release --target aarch64-linux-android\n```\n\n## Post install (Linux)\n\nSince `bandwhich` sniffs network packets, it requires elevated privileges.\nOn Linux, there are two main ways to accomplish this:\n\n### 1. `setcap`\n\n- Permanently allow the `bandwhich` binary its required privileges (called \"capabilities\" in Linux).\n- Do this if you want to give all unprivileged users full access to bandwhich's monitoring capabilities.\n    - This is the **recommended** setup **for single user machines**, or **if all users are trusted**.\n    - This is **not recommended** if you want to **ensure users cannot see others' traffic**.\n\n```sh\n# assign capabilities\nsudo setcap cap_sys_ptrace,cap_dac_read_search,cap_net_raw,cap_net_admin+ep $(command -v bandwhich)\n# run as unprivileged user\nbandwhich\n```\n\n#### Capabilities explained\n- `cap_sys_ptrace,cap_dac_read_search`: allow access to `/proc/\u003cpid\u003e/fd/`, so that `bandwhich` can determine which open port belongs to which process.\n- `cap_net_raw,cap_net_admin`: allow capturing packets on your system.\n\n### 2. `sudo` (or alternative)\n\n- Require privilege escalation every time.\n- Do this if you are an administrator of a multi-user environment.\n\n```sh\nsudo bandwhich\n```\n\nNote that if your installation method installed `bandwhich` to somewhere in\nyour home directory (you can check with `command -v bandwhich`), you may get a\n`command not found` error. This is because in many distributions, `sudo` by\ndefault does not keep your user's `$PATH` for safety concerns.\n\nTo overcome this, you can do any one of the following:\n1. [make `sudo` preserve your `$PATH` environment variable](https://unix.stackexchange.com/q/83191/375550);\n2. explicitly set `$PATH` while running `bandwhich`: `sudo env \"PATH=$PATH\" bandwhich`;\n3. pass the full path to `sudo`: `sudo $(command -v bandwhich)`.\n\n## Post install (Windows)\n\nYou might need to first install [npcap](https://npcap.com/#download) for capturing packets on Windows.\n\n## Usage\n\n```\nUsage: bandwhich [OPTIONS]\n\nOptions:\n  -i, --interface \u003cINTERFACE\u003e      The network interface to listen on, eg. eth0\n  -r, --raw                        Machine friendlier output\n  -n, --no-resolve                 Do not attempt to resolve IPs to their hostnames\n  -s, --show-dns                   Show DNS queries\n  -d, --dns-server \u003cDNS_SERVER\u003e    A dns server ip to use instead of the system default\n      --log-to \u003cLOG_TO\u003e            Enable debug logging to a file\n  -v, --verbose...                 Increase logging verbosity\n  -q, --quiet...                   Decrease logging verbosity\n  -p, --processes                  Show processes table only\n  -c, --connections                Show connections table only\n  -a, --addresses                  Show remote addresses table only\n  -u, --unit-family \u003cUNIT_FAMILY\u003e  Choose a specific family of units [default: bin-bytes] [possible values: bin-bytes, bin-bits, si-bytes, si-bits]\n  -t, --total-utilization          Show total (cumulative) usages\n  -h, --help                       Print help (see more with '--help')\n  -V, --version                    Print version\n```\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\n## License\n\nMIT\n","funding_links":["https://github.com/sponsors/imsnif"],"categories":["Rust","Utilities","Monitoring","Applications","cli","应用程序 Applications","\u003ca name=\"infra\"\u003e\u003c/a\u003einfra","Command Line Tools","CSS","终端","Table of Contents","Tools","语言资源库","\u003ca name=\"networking\"\u003e\u003c/a\u003eNetworking","System Monitoring","System Monitor","\\*nix/\\*nux","Network","Networking","💻 Apps"],"sub_categories":["Internet Speedtest","Management Tool","System tools","Utilities","系统工具 System tools","网络服务_其他","Rust","rust","Other","Networking","🌐 Networking and Internet"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsnif%2Fbandwhich","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimsnif%2Fbandwhich","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsnif%2Fbandwhich/lists"}