{"id":16603196,"url":"https://github.com/laserpants/mbs","last_synced_at":"2026-05-05T06:34:56.828Z","repository":{"id":148169717,"uuid":"113006114","full_name":"laserpants/mbs","owner":"laserpants","description":":hourglass_flowing_sand: Command line tool to help keeping a tab on data usage.","archived":false,"fork":false,"pushed_at":"2019-12-24T22:11:42.000Z","size":671,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T08:29:50.199Z","etag":null,"topics":["c","c99","cli-tool","linux","networking"],"latest_commit_sha":null,"homepage":"https://laserpants.github.io/mbs","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laserpants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-12-04T06:49:58.000Z","updated_at":"2022-07-23T10:36:16.000Z","dependencies_parsed_at":"2023-05-19T08:45:25.044Z","dependency_job_id":null,"html_url":"https://github.com/laserpants/mbs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fmbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fmbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fmbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fmbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laserpants","download_url":"https://codeload.github.com/laserpants/mbs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266566,"owners_count":20910836,"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":["c","c99","cli-tool","linux","networking"],"created_at":"2024-10-12T00:48:10.788Z","updated_at":"2026-05-05T06:34:51.808Z","avatar_url":"https://github.com/laserpants.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mbs [![Build Status](https://img.shields.io/travis/laserpants/mbs/master.svg?style=flat)](https://travis-ci.org/laserpants/mbs)\n\nA command line tool to keep track of the amount of data sent and received over \na network interface. This can be convenient for monitoring data usage against a \npre-paid bundle or some other fixed usage limit.\n\n### Building\n\n1. Install [ncurses](https://www.gnu.org/software/ncurses/). For Linux systems, \nsee [this page](https://www.cyberciti.biz/faq/linux-install-ncurses-library-headers-on-debian-ubuntu-centos-fedora/).\n2. Clone this repo. **Note:** The `--recursive` flag (to download git submodules) is required.\n\n```bash\ngit clone --recursive https://github.com/laserpants/mbs/\n```\n\n3. To build and install the command:\n\n```bash\ncd build\ncmake ..\nmake\n```\n\nUse `sudo make install` to install the executable, or `make test` to run the tests.\n\n```bash\n$ mbs --version\nmbs version 0.1.2\n```\n\n### Usage\n\n```\nmbs [-vkp] [--help] [--version] [--ascii] [-a \u003camount\u003e] [--statsfile=\u003cpath\u003e] [\u003cinterface\u003e]\n```\n\nIf no `\u003cinterface\u003e` is given, the program will try to automatically find an \nactive network interface (excluding `lo`).\n\n#### Examples\n\nSet the amount of data available using the `--available` (`-a`) flag to run\nthe command in *countdown* mode. The following example specifies a data limit \nof 300 KB.\n\n```\nmbs -a 300K\n```\n\n![mbs](https://github.com/laserpants/mbs/blob/master/mbs.gif)\n\nTo tell the command to monitor the network interface `wlan0`:\n\n```\nmbs -a 300K wlan0\n```\n\nBy default, the command will exit once the usage limit is reached, or if the \nconnection is lost. Use the `--keep-running` flag to modify this behavior.\n\n```\nmbs -a 10K --keep-running\n```\n\nYou can also omit the `--available` flag, in which case the command will \nrun indefinitely \u0026ndash; showing the amount of data used since it started.\n\n![mbs](https://raw.githubusercontent.com/laserpants/mbs/master/mbs2.gif)\n\nIf the `--ascii` flag is provided, only characters in the (extended) ASCII \ncharacter set are used in the interface:\n\n![mbs](https://raw.githubusercontent.com/laserpants/mbs/master/mbs3.gif)\n\n#### Persistent sessions\n\nWhen the command is run with the `--persistent` (`-p`) flag, it will try to \nresume from where the last session ended. It does so by reading the last \nsaved state (sent and received bytes count) from a *stats* file. Note that this \nwill not work if the kernel's TX/RX counters were reset since the last time the \ncommand was run (e.g., after a system reboot).\n\nThe stats file's location can be set using the `--statsfile=\u003cpath\u003e` flag. If \nthis flag is not provided, then `$HOME/.mbs` is used as a default.\n\n### Flags\n\n| Flag             | Short option   | Description                             |\n|------------------|----------------|-----------------------------------------|\n| `--help`         |                | Display help and exit.                  |\n| `--version`      |                | Display version info and exit.          |\n| `--verbose`      | `-v`           | Render verbose output.                  |\n| `--ascii`        |                | Disable non-ascii Unicode characters.   |\n| `--keep-running` | `-k`           | Do not exit when data limit is exceeded or connection is lost. |\n| `--persistent`   | `-p`           | Continue from where last session ended. (See [Persistent sessions](https://github.com/laserpants/mbs#persistent-sessions).) |\n| `--available`    | `-a`           | Amount of data available to use in your subscription plan or budget. |\n| `--statsfile`    |                | Override default stats file path. (See [Persistent sessions](https://github.com/laserpants/mbs#persistent-sessions).) |\n\nThe `--available` argument accepts the following suffixes:\n\n| Suffix                     | Unit                   | Size             |\n|----------------------------|------------------------|------------------|\n| **B**, **b**, or no suffix | Bytes                  | 1                |\n| **kB**, or **k**           | Kilobyte               | 1000             |\n| **KB**, **K**, or **KiB**  | Kibibyte\u003csup\u003e†\u003c/sup\u003e   | 2\u003csup\u003e10\u003c/sup\u003e   |\n| **mB**, or **m**           | Megabyte               | 1000\u003csup\u003e2\u003c/sup\u003e |\n| **MB**, **M**, or **MiB**  | Mebibyte\u003csup\u003e†\u003c/sup\u003e   | 2\u003csup\u003e20\u003c/sup\u003e   |\n| **gB**, or **g**           | Gigabyte               | 1000\u003csup\u003e3\u003c/sup\u003e |\n| **GB**, **G**, or **GiB**  | Gibibyte\u003csup\u003e†\u003c/sup\u003e   | 2\u003csup\u003e30\u003c/sup\u003e   |\n\n†) Defined by the International Electrotechnical Commission (IEC).\n\nA decimal point can also be used; e.g., `mbs -a 100.5M`.\n\n### Third-party libraries\n\nThis repository includes [Argtable3](http://www.argtable.org/) as a git submodule. The Argtable3 library is copyright (c) 1998-2001, 2003-2011 Stewart Heitmann and licensed under the 3-Clause BSD License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaserpants%2Fmbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaserpants%2Fmbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaserpants%2Fmbs/lists"}