On Ubuntu, I'd like to know how many megabytes have come in (download) or gone out (upload) of my computer via the network in the last month, or week or whatever (the longer the better). Is there any place where I can see this kind of statistics? Or, is there any log file where for example every connection gets logged with the total amount of bytes sent and received, so that I could do a little bit of grepping of those log files and compute a sum?
Many useful commands below:
e.g. I used ifconfig ppp0 to find bytes being transferred on the broadband dongle which gets named ppp0 when connected on my ubuntu 12.04. If I disconnect and reconnect, it will give the fresh number of bytes transferred on next invocation so I can know whether the total data transfer is within limits.
Note that I haven't found a way yet to find number of bytes transferred last month/week etc but if I remember my last search on same subject there probably isn't any tool available like that. So you may have to write your own script of some kind which collects such data and saves it in a log or database for later summing up.