Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
11-06-2005, 09:00 AM
|
#1
|
Member
Registered: Mar 2003
Posts: 404
Rep:
|
Is there a terminal command that I can run that will...........
Hi,
Is there a terminal command that I can run that will give me a readout of the upload and download of my network interface (eth0) every few seconds?
I've been trying to find something like this but can't.
I want it to run in a terminal and not a gui.
Can anyone help?
thanks
Ludwig
|
|
|
11-06-2005, 09:47 AM
|
#2
|
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284
Rep:
|
You tried iptraf ? Lets you view different real-time reports for your interfaces depending on what data you're wishing to view.
|
|
|
11-06-2005, 09:51 AM
|
#3
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
thanks for the info, mate.
Is there a native UNIX command that would do that, rather than a 3rd party program?
cheers 
|
|
|
11-06-2005, 09:57 AM
|
#4
|
Member
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249
Rep:
|
As root type:
ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}' for total downloaded and ifconfig eth0 | grep 'RX bytes' | awk '{print $7 $8}' for total uploaded.
|
|
|
11-06-2005, 10:02 AM
|
#5
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
thanks mickyg.
However, I'm really looking for a readout that updates every few seconds that tells me the data rate uploaded and downloaded in kB/s
Any idea about that?
cheers mate 
|
|
|
11-06-2005, 10:48 AM
|
#6
|
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Fedora40
Posts: 6,153
|
Check out gkrellm:
http://members.dslextreme.com/users/...m/gkrellm.html
Edit: Ooops! You ask for a terminal command.... But have you considered how messy this will make your terminal?
Last edited by tredegar; 11-06-2005 at 10:50 AM.
|
|
|
11-06-2005, 10:58 AM
|
#7
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
well, I can have several terminals open at once.
The reason I only want terminals is that I have a really low powered box that runs blackbox and runs as an NFS server 24/7. It's too low powered to run KDE or Gnome effectively, so I'd prefer just to run Blackbox and not have any gui's.
I would have thought that there must be a unix command that monitors eth0????
|
|
|
11-06-2005, 09:48 PM
|
#8
|
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549
Rep:
|
Quote:
Distribution: thanks mickyg.
However, I'm really looking for a readout that updates every few seconds that tells me the data rate uploaded and downloaded in kB/s
|
Code:
watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
will update every 1 second
Code:
I would have thought that there must be a unix command that monitors eth0????
There are plenty of monitoring programs for Linux - iptraf (as already suggested), dstat, ntop are just some. These are all Linux command line programs.
Last edited by tkedwards; 11-06-2005 at 09:49 PM.
|
|
|
11-07-2005, 01:48 AM
|
#9
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
Quote:
watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
|
Thanks tkedwards....that works great.
However, if I wanted kb instead of bytes, how would I do that?
Cheers
Ludwig 
|
|
|
11-07-2005, 02:09 AM
|
#10
|
Senior Member
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528
Rep:
|
you could convert the output if you want
|
|
|
11-07-2005, 02:18 AM
|
#11
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
sorry to be dumb, but how would you do that?
|
|
|
11-07-2005, 01:14 PM
|
#12
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
actually, what I've found is that this doesn't work great.
Quote:
watch -n 1 "/sbin/ifconfig eth0 | grep 'RX bytes' | awk '{print $3 $4}'"
|
This seems to give me the total amount downloaded and uploaded.
That's not what I want.
I want the RATE at which things are being downloaded and uploaded.
i.e. kb/s
Can anyone help me with that?????
Cheers
Ludwig
|
|
|
11-07-2005, 01:52 PM
|
#13
|
Member
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310
Rep:
|
ethstats does exactly what you are looking for. However you will need to install it..
Here is a example of the output..
Code:
Pinky:~# ethstats
total: 2.87 Mb/s In 0.23 Mb/s Out - 620.0 p/s In 287.0 p/s Out
eth0: 0.23 Mb/s In 0.23 Mb/s Out - 288.0 p/s In 287.0 p/s Out
eth1: 2.65 Mb/s In 0.00 Mb/s Out - 332.0 p/s In 0.0 p/s Out
total: 2.56 Mb/s In 0.25 Mb/s Out - 613.1 p/s In 316.0 p/s Out
eth0: 0.25 Mb/s In 0.25 Mb/s Out - 315.7 p/s In 316.0 p/s Out
eth1: 2.31 Mb/s In 0.00 Mb/s Out - 297.4 p/s In 0.0 p/s Out
total: 2.63 Mb/s In 0.24 Mb/s Out - 607.8 p/s In 304.6 p/s Out
eth0: 0.24 Mb/s In 0.24 Mb/s Out - 305.1 p/s In 304.6 p/s Out
eth1: 2.39 Mb/s In 0.00 Mb/s Out - 302.7 p/s In 0.0 p/s Out
total: 2.86 Mb/s In 0.21 Mb/s Out - 605.2 p/s In 270.4 p/s Out
eth0: 0.21 Mb/s In 0.21 Mb/s Out - 270.7 p/s In 270.4 p/s Out
eth1: 2.65 Mb/s In 0.00 Mb/s Out - 334.5 p/s In 0.0 p/s Out
|
|
|
11-07-2005, 02:44 PM
|
#14
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
|
|
|
11-07-2005, 03:02 PM
|
#15
|
Member
Registered: Mar 2003
Posts: 404
Original Poster
Rep:
|
fur,
thanks mate.
It works a treat!!!!!!
|
|
|
All times are GMT -5. The time now is 05:40 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|