You are not logged in.

#1 2009-05-06 00:35:56

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

I think this is really a stupid question

$ ONE_LINE_COMMAND

just to get the current download/upload speed, one line output, no need for fancy bars / refreshing blocks etc.
i've been using conky for a while, never wondered how to get the network RX/TX speeds without it. in conky it is so simple, just ${upspeed wlan0}

Anyone just tell me please !


This silver ladybug at line 28...

Offline

#2 2009-05-06 01:31:28

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: I think this is really a stupid question

come up with something like this

$ echo $(echo $(echo -n `ifconfig wlan0 | grep 'RX bytes'|sed 's/.*:\([0-9]*\) (.*/\1/'`;echo -n "-";sleep 10;echo -n `ifconfig wlan0 | grep 'RX bytes'|sed 's/.*:\([0-9]*\) (.*/\1/'`;)|bc;echo -n '/(-10)')|bc

this is quite a stupid answer and outputs a 10-minute average speed in bytes/s, which i'm also not sure how accurate ..


This silver ladybug at line 28...

Offline

#3 2009-05-06 02:02:05

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: I think this is really a stupid question

do you know vnstat?

Maybe can help

$ vnstat -tr | awk '$1 ~ /rx/ {print $2}'
320.14

You can especify the time of sample seconds in -tr parameter by default is 5

Offline

#4 2009-05-06 03:23:32

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: I think this is really a stupid question

djgera wrote:

do you know vnstat?

Maybe can help

$ vnstat -tr | awk '$1 ~ /rx/ {print $2}'
320.14

You can especify the time of sample seconds in -tr parameter by default is 5

yay,looks nice!:D
though don't have a clue that it is doing inside.. isn't there a simpler and director way to do it?


This silver ladybug at line 28...

Offline

Board footer

Powered by FluxBB