-   Linux - Networking (
-   -   Monitor eth0, number of bytes passed through?? (

helptonewbie 09-03-2006 04:22 PM

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

gilead 09-03-2006 04:50 PM

If you only need to see the bytes in/out of your PC you can use ifconfig:

/sbin/ifconfig eth0 | grep 'TX bytes'
I've never needed to do it by each IP address though...

helptonewbie 09-03-2006 06:00 PM

thanks, i've managed to get it to what i want via

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

amitsharma_26 09-04-2006 07:20 PM

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"

helptonewbie 09-06-2006 10:49 AM

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

All times are GMT -5. The time now is 10:18 PM.