Track monthly data usage with vnstat
A lightweight daemon logs traffic per interface so you can check daily and monthly totals anytime.
01Command
$ vnstat -m02What it does
vnstat runs a tiny background daemon that reads the kernel's interface counters every few minutes and stores them in a database — it doesn't sniff traffic, so it uses almost no CPU. After it has run for a day or more, vnstat -m shows how much you uploaded and downloaded each month, which is exactly what capped broadband and mobile hotspot users need. Real-time speed still needs nethogs or iftop.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- vnstat(1) — manual pageEvidence: vnstat keeps a history of transferred data per interface and can display daily (-d) or monthly (-m) summaries.
- vnstat(1) — Ubuntu manual pageEvidence: vnstat -m shows monthly traffic from a database continuously populated by the vnstatd daemon; -d shows daily figures.
Last verified: 2026-09-18 · Category: Network
06Related solutions
Use free -h to see used, free, and available memory plus swap in GB/MiB instead of raw kilobytes.
One command that prints every interface with its state and IPv4/IPv6 addresses in a short table — the modern, memorable replacement for digging through `ifconfig` or the verbose `ip addr` output.
The classic forgotten-syntax command: `traceroute` shows every router between you and a destination plus the round-trip time of probes to each hop.