LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-06-2005, 09:00 AM   #1
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Rep: Reputation: 30
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
 
Old 11-06-2005, 09:47 AM   #2
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
You tried iptraf ? Lets you view different real-time reports for your interfaces depending on what data you're wishing to view.
 
Old 11-06-2005, 09:51 AM   #3
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
thanks for the info, mate.

Is there a native UNIX command that would do that, rather than a 3rd party program?


cheers
 
Old 11-06-2005, 09:57 AM   #4
mickyg
Member
 
Registered: Oct 2004
Location: UK
Distribution: Ubuntu/Kubuntu
Posts: 249

Rep: Reputation: 30
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.
 
Old 11-06-2005, 10:02 AM   #5
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
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
 
Old 11-06-2005, 10:48 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.
 
Old 11-06-2005, 10:58 AM   #7
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
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????
 
Old 11-06-2005, 09:48 PM   #8
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
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.
 
Old 11-07-2005, 01:48 AM   #9
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
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
 
Old 11-07-2005, 02:09 AM   #10
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 47
you could convert the output if you want
 
Old 11-07-2005, 02:18 AM   #11
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
sorry to be dumb, but how would you do that?
 
Old 11-07-2005, 01:14 PM   #12
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
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
 
Old 11-07-2005, 01:52 PM   #13
fur
Member
 
Registered: Dec 2003
Distribution: Debian, FreeBSD
Posts: 310

Rep: Reputation: 35
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
 
Old 11-07-2005, 02:44 PM   #14
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
kewl....thanks fur!!!!!!!!!!!!!

I'll give it a shot............
 
Old 11-07-2005, 03:02 PM   #15
ludwig W
Member
 
Registered: Mar 2003
Posts: 404

Original Poster
Rep: Reputation: 30
fur,
thanks mate.
It works a treat!!!!!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
run command in new gnome-terminal checkchan Linux - General 10 08-29-2012 03:55 AM
Command to run another command against a list of files psweetma Linux - General 3 11-09-2005 05:29 PM
How to run MP3 file thru Terminal in K.D.E or Terminal itz2000 Linux - Newbie 5 08-04-2005 09:49 PM
Run user command on Terminal startup coolfrog Linux - General 4 09-26-2004 09:08 AM
start terminal & run command automatically peeples Linux - General 2 09-08-2003 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration