Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to write a shell (bash) script that prints the system's download and/or upload capacities (in Kbps):

# Get download bandwidth
sh fetch-bandwidth.sh DOWNLOAD

> 556 Kbps download bandwidth

# Get upload bandwidth
sh fetch-bandwidth.sh UPLOAD

> 374 Kbps upload bandwidth

I can take care of the boilerplate stuff (validating arguments for input, formatting and printing output, etc.), however I'm clueless what to use for actually querying the system for the bandwidth values. Thanks in advance!

share|improve this question
add comment

1 Answer

iperf might be a start (I don't know if it works over the internet - I see no reason for it not to work):

Iperf was developed by NLANR/DAST as a modern alternative for measuring maximum TCP and UDP bandwidth performance. Iperf allows the tuning of various parameters and UDP characteristics. Iperf reports bandwidth, delay jitter, datagram loss.

share|improve this answer
    
Thanks @Renan (+1) - definitely something worth looking at, but I was sort of hoping to find something baked into the distro. There aren't any "standard" Linux tools that provide this kind of information? Thanks again! –  pnongrata Dec 23 '12 at 23:33
    
@pnongrata As far as I know, no. –  Renan Dec 24 '12 at 0:10
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.