Linux: Get Realtime Bandwidth Statistics Using Stock Commands

November 14, 2006
linux-penguin

Have you ever been in Linux and wanted to watch how much bandwidth was going in and out of your box? Most have, and here’s a very simply way to do it without a GUI or installing anything extra:

# watch -n1 "ifconfig eth0 | grep Mb"

RX bytes:105209490 (100.3 Mb)  TX bytes:448524558 (427.7 Mb)

Just change your network interface in the grep bit to the one you want and you’re all set. Oh, and if you’re using Debian or Ubuntu, you may want to try grepping for "Mib" instead of "Mb".

Enjoy.:

supporting = loving

Since 1999 I've been creating ad-free technical tutorials and essays here. It's a one-person effort that's also my life and livelihood. If it makes your day more livable in any way, please consider supporting the work with a monthly or one-time donation. Your support means a lot to me, and makes all the difference. 🫶🏼