Try this
apt-get install vnstat
Using the command vnstat, you can get the output like this
Bandwidth Usage:
Database updated: Tue Aug 23 12:28:57 2016
eth0 since 08/21/16
rx: 4.39 GiB tx: 4.39 GiB total: 8.79 GiB
monthly
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
Aug '16 4.39 GiB | 4.39 GiB | 8.79 GiB | 37.88 kbit/s
------------------------+-------------+-------------+---------------
estimated 6.05 GiB | 6.04 GiB | 12.09 GiB |
daily
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
yesterday 3.89 GiB | 3.33 GiB | 7.21 GiB | 700.18 kbit/s
today 24.76 MiB | 965.80 MiB | 990.56 MiB | 180.58 kbit/s
------------------------+-------------+-------------+---------------
estimated 46 MiB | 1.81 GiB | 1.86 GiB |