The Cookie Machine - Click here to drag window

DUMMY TEXT - Real text set in assets/js/theCookieMachine.js

If you can read me, I'm broken!

Views: 6,694     Votes:  1     ✅ Solution
Tags: networking   vnstat  
Link: 🔍 See Original Answer on Ask Ubuntu ⧉ 🔗

URL: https://askubuntu.com/q/1011687
Title: Monitor network traffic "during a specific time" in linux
ID: /2018/03/04/Monitor-network-traffic-_during-a-specific-time_-in-linux
Created: March 4, 2018    Edited:  June 12, 2020
Upload: September 15, 2024    Layout:  post
TOC: false    Navigation:  false    Copy to clipboard:  false


vnstat -l does do what you need

Simply open a terminal window and type vnstat -l. Then start your program that consumes network bandwidth. When your program ends return to the terminal window and press Ctrl+C. The terminal will then show time elapsed and network traffic consumed:

$ vnstat -l
Monitoring enp59s0...    (press CTRL-C to stop)

   rx:     1.74 Mbit/s   149 p/s          tx:       32 kbit/s    62 p/s^C


 enp59s0  /  traffic statistics

                           rx         |       tx
--------------------------------------+------------------
  bytes                     7.40 MiB  |         142 KiB
--------------------------------------+------------------
          max            1.84 Mbit/s  |       35 kbit/s
      average            1.68 Mbit/s  |    31.53 kbit/s
          min            1.51 Mbit/s  |       29 kbit/s
--------------------------------------+------------------
  packets                       5215  |            2187
--------------------------------------+------------------
          max                157 p/s  |          68 p/s
      average                144 p/s  |          60 p/s
          min                129 p/s  |          55 p/s
--------------------------------------+------------------
  time                    36 seconds
⇧ Print screen key opens default browser on Kubuntu. How to fix? The brightness of laptop screen cannot be adjusted with either the buttons or the slider. Edit  ⇩