7

I want a command line feature to show me how much data I am using each day / week / month. It needs to show speed as well as data usage.

Tim
  • 33,510
sigdelsanjog
  • 7,280

1 Answers1

12

You can use vnstat. It is a command line tool that can keep track of downloaded or uploaded data volume. To install vnstat type in terminal,

sudo apt-get install vnstat

Sample output:


$ vnstat
Database updated: Sat Oct 15 11:54:00 2011

   eth0 since 10/01/11

          rx:  12.89 MiB      tx:  6.94 MiB      total:  19.82 MiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       Sep '11     12.90 MiB |    6.90 MiB |   19.81 MiB |    0.14 kbit/s
       Oct '11     12.89 MiB |    6.94 MiB |   19.82 MiB |    0.15 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated        29 MiB |      14 MiB |      43 MiB |

     daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday      4.30 MiB |    2.42 MiB |    6.72 MiB |    0.64 kbit/s
         today      2.03 MiB |    1.07 MiB |    3.10 MiB |    0.59 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated         4 MiB |       2 MiB |       6 MiB |

There are many options available to obtain customized results. See thegeekstuff for more.

sourav c.
  • 46,280
  • That's a really cool command I have not seen before! You could also get a much less accurate answer using ifconfig etho, but that will show everything sent and received - including control information, not just uploads and downloads. Also, if your router has a web interface like most do, it may display similar information on one of its status pages. Again, this is for everything, not just a particular type of data/traffic. – Joe Dec 17 '14 at 04:51
  • It shows the traffic on the network interfaces without distinguishing the source/target where the data are coming from/to. I.e. the local network traffic is included as well. Internet downloads/uploads I can see only on my router administration pages, but that does not group the information by connected devices, so I can see only the total there, without being able to identify the most hungry devices. – user1182474 Oct 26 '20 at 08:20