Linux – How to get current bandwidth usage from command line using built-in Linux tools

bandwidthcommand linelinuxmonitoringnetworking

I'm looking for a good way to get the current total bandwidth usage on a linux machine. I’ve tried iftop, nethogs, but they don’t show real bandwidth usage compared to system monitor; they don’t suit the needs of my project. I want a command which I execute and it returns the current usage for upload and download and nothing else.

I would like also to do it with native Linux tools without installing anything. In fact I’m making a monitoring application, and I want it to be able to monitor computers without the need to install something in each computer the user wants to monitor, that would be great!

Best Answer

Use iptraf - http://www.linuxcommand.org/man_pages/iptraf8.html

It's an ncurses based commandline utility which is able to give you statistics on all interfaces on the machine - including bandwidth usage.

Related Question