LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-03-2006, 04:22 PM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Smile Monitor eth0, number of bytes passed through??


Is there a way using a bash command to monitor the amount of bytes being sent from the computer to another. Meaning i want to send a lot of files and i want to monitor the amount of bytes being transfered from the computer thats sending the files. ie, the computer monitors the size of files its sent every few seconds or something and can show it in the console. I will setup all the timing and stuff i just dont know if there's a command that can do this or is there anything i can see using a bash command that would show the amount of data sent.??

Thanks for any ideas
Marcus
 
Old 09-03-2006, 04:50 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
If you only need to see the bytes in/out of your PC you can use ifconfig:
Code:
/sbin/ifconfig eth0 | grep 'TX bytes'
I've never needed to do it by each IP address though...
 
Old 09-03-2006, 06:00 PM   #3
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Smile

thanks, i've managed to get it to what i want via
Code:
ifconfig eth0 | grep 'TX bytes' | cut -d' ' -f17 | cut -d':' -f2 > file
show up only the bytes ben sent which i can output to a file or variable which is what i needed thanks
 
Old 09-04-2006, 07:20 PM   #4
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
And even to make it look more live & get a working feel;

Try this..
#watch -n1 "ifconfig eth1 | grep 'TX bytes' | cut -d' ' -f17 | cut -d':' -f2"
 
Old 09-06-2006, 10:49 AM   #5
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Smile

Thanks for that Amit, i can have looked at that and checked out what it does. Its a good feature and am looking to actually use it somewhere else, doesn't quite work with what i was trying to get but its still very useful to know so thanks
Regards
Mark
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
You passed an undefined mode number priest_judas Linux - Newbie 12 02-08-2005 05:16 PM
Calculation of number of bytes submitted with form blampain Linux - Networking 6 03-30-2004 05:54 AM
You passed an undefined mode number priest_judas Linux - Hardware 3 12-11-2003 04:19 PM
Slack 9.1 - You passed an undefined mode number priest_judas Slackware 1 12-11-2003 07:56 AM
You have passed an undefined mode number. acidslut Slackware 5 08-17-2003 11:00 PM


All times are GMT -5. The time now is 03:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration