Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to get the current Bandwidth of an interface say "eth0" from the terminal. It better be as simple as possible. Say up 10 dn 30. Instead of giving out a lot of text like "vnstat" does.

Edit: I need this for a command line program for auto-monitoring, not to view it manually.

share|improve this question
    
you could try iftop –  Alexej Magura Dec 24 '13 at 19:06

2 Answers 2

up vote 8 down vote accepted

There are several tools that can do this.

Bmon

One that should be in most repositories for various distros is bmon.

    ss of bmon

It can be run in a condensed view too.

           ss of bmon small

If you're looking for something else I'd suggest taking a look at this Linuxaria article titled: Monitor your bandwidth from the Linux shell. It also mentions nload as well as speedometer.

Nload

    ss of nload

Speedometer

            ss of speedometer

Ibmonitor

If you're looking for something more basic then you could also give ibmonitor a go. Though basic it has most of the features one would expect when monitoring bandwidth.

            ss of ibmonitor

share|improve this answer
1  
And don't forget iftop. –  n.st Dec 1 '13 at 17:02
    
@n.st - familiar with it, but didn't mention it since he wanted bandwidth methods, and that shows per process, similar to top. –  slm Dec 1 '13 at 17:07
    
It does display the total bandwidth too, but I'll agree that it's probably less than ideal for automatic evaluation by a script like the OP intends to. –  n.st Dec 1 '13 at 17:09
1  
@n.st - yeah that's why I left it out, but I do use it regularly for finding mis-behaving network users 8-) –  slm Dec 1 '13 at 17:10

You can also use Linux process explorer. It can monitor bandwidth usage per process.

share|improve this answer
2  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. –  manatwork Dec 24 '13 at 12:51
1  
The question asked for a command-line program. –  Gilles Dec 24 '13 at 17:22

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.