Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Are there any tools to check data usage of USB datacard on Linux? The way can be done on Windows, is it possible on Linux also?

share|improve this question
    
You mean total traffic through Datacard. –  atenz Jul 16 '12 at 18:16
    
Are you referring to an USB modem? If so, can you provide your ISP and used modem? –  Cumulus007 Jul 16 '12 at 18:16
    
Yes, total traffic through a datacard. –  R11G Jul 16 '12 at 18:17
    
@Cumulus007 Idk if you know/heard the ISP I am using. It is MTS and a USB datacard. –  R11G Jul 16 '12 at 18:18
    
I understand, but what is the make/brand? Try lsusb to identify the USB modem. –  Cumulus007 Jul 16 '12 at 18:21
show 1 more comment

1 Answer 1

Use vnstat

sudo apt-get install vnstat

Then first check which Interfaces are available through

vnstat --iflist

Available interfaces: lo eth0 , the eth0 for Wired connection, yours will be different (wlan0 i guess)

Then run

vnstat

It will be something like this

 eth0 since 05/23/12

          rx:  20.66 GiB      tx:  5.35 GiB      total:  26.01 GiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       Jun '12      9.18 GiB |    2.28 GiB |   11.47 GiB |   37.11 kbit/s
       Jul '12      6.35 GiB |    1.48 GiB |    7.83 GiB |   47.50 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated     12.30 GiB |    2.87 GiB |   15.16 GiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    241.20 MiB |  122.44 MiB |  363.64 MiB |   34.48 kbit/s
         today        81 KiB |      54 KiB |     135 KiB |    3.22 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated        --     |      --     |      --     |

You can use vnstat accordingly ,

 vnstat -s   << -s for short output mode

                      rx      /      tx      /     total    /   estimated
 eth0:
       Jun '12      9.18 GiB  /    2.28 GiB  /   11.47 GiB
       Jul '12      6.35 GiB  /    1.48 GiB  /    7.83 GiB  /   15.17 GiB
     yesterday    241.20 MiB  /  122.44 MiB  /  363.64 MiB
         today        35 KiB  /      14 KiB  /      49 KiB  /      --  

Similarly vnstat -d for daily basis record ,vnstat -h for hourly basis and you can refer other usage through the Vnstat Manpage .

Another Web Browser based utility is NTOP

share|improve this answer
    
Thanks. it works. Although it is eth1 rather than wlan0. –  R11G Jul 17 '12 at 2:39
    
It doesnt let me do that as I don't have 15 reputation. –  R11G Jul 18 '12 at 15:09
    
Its fine , in future maybe, Thanks though. –  atenz Jul 18 '12 at 15:11
    
vnstat -m : For month –  totti May 15 '13 at 9:57
add comment

Your Answer

 
discard

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.