Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just need to get how much bandwidth is used in 3 or 4 days. Do you have any application in the terminal to do it?

I'd prefer if it didn't use SNMP.

I found iptraf, wireshark, cacti, but they were not what I am looking for.

Of course I need to save my results; for a single computer, not a network.

It's very important that I can see the total size of inbound and outboud traffic. What solutions are there for me?

share|improve this question
up vote 6 down vote accepted

You know you already have that with ifconfig right?

Ifconfig keeps counters about your incomming and outgoing bandwidth on each interface by default. Usually you can't reset counters except rebooting (with a few exceptions)

From console you can easily leave a cron running each three days and saving results to a file for later check. Something like this:

date >> ~/bw.log && ifconfig eth0|grep byte >> ~/bw.log

Will produce this kind of output per run on the file bw.log at users home.

Thu Oct 18 03:44:05 UTC 2012
      RX bytes:414910161 (395.6 MiB)  TX bytes:68632105 (65.4 MiB)

My two cents...

share|improve this answer
Is it possible to reset this counter without breaking network connectivity? – l0b0 Oct 18 '12 at 9:12
@l0b0 It will always break, as when you restart networking configuration. However, if done right it will mean no more than a couple of seconds without connectivity. – Valor Oct 18 '12 at 16:35

vnstat can log how many bytes have been transferred for an interface, but not application based, you can only know the bytes as a whole.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.