measure network bandwidth of command line app or script

2

1

How can I "box" a command line app or a script im running, to tell how much bandwidth it used?

e.g. I want to run wget -rk http://example.com. Now this example is easy, since wget can report it's own bandwidth. But if im invoking several wget instances in a script, that requires me to start writing code to add the numbers up. If i'm using additional tools in the script that use the network, i need to make sure to add into the calculation the bandwidth that they generate.

This sounds complex, and I'm wondering if I could just measurebandwidthAndExecute ./script.sh?

wildeyes

Posted 2016-10-17T13:39:44.833

Reputation: 250

some of the answers to this question on unix.stackexchange may be relevant, particularly the one on pv / pipe viewer?

– 0range – 2016-10-17T13:53:02.033

No answers