0

Like in Windows OS, I look for a way to see how much data has been used since I connected to a Wi-Fi network. I only came accross with vnstat, however, either it cannot provide what I want, or I could not manage to do it.

My desired operation:

I connected to a wi-fi at 1:00 pm let's say. Then at 2:00 pm, I wanted to see how much data I have used so far. What should I do?

Thanks.

p.s : Ubuntu 20.04

muyustan
  • 288

1 Answers1

1

There are multiple options for that:

1) you can refer to the output of ifconfig <name_of_your_interface>:

$ /sbin/ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet [redacted]  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 [redacted]  prefixlen 64  scopeid 0x20<link>
        ether [redacted]  txqueuelen 1000  (Ethernet)
        RX packets 2911989  bytes 3104700566 (2.8 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1741814  bytes 307260264 (293.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In the RX bytes line, you have the number of received bytes

        RX packets 2911989  bytes 3104700566 (2.8 GiB)

In the TX bytes line, you have the number of sent bytes

        TX packets 1741814  bytes 307260264 (293.0 MiB)

2) Refer to How to get TX/RX bytes without ifconfig?:

cat /proc/net/dev

3) You can use netstat -i (columns RX-OK and TX-OK)

4) ip -s link

5) If you want a live usage, you can use iftop (may need to be installed with apt, needs root privileges)

Musinux
  • 156