Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

question is in title, best would be from some file in /sys instead of parsing output of iwlist ?

I need this number from output of iwconfig "Bit Rate=54 Mb/s".


share|improve this question
after searching more about this, i found out that even iwconfig is calling syscall ioctl(d, SIOCGIWRATE, ...). So, parsing output of iwconfig or customizing source code of iwconfig would be optional. – Denwerko May 2 '11 at 23:09
up vote 1 down vote accepted

I guess this would do it.

iwconfig wlan0 | grep Bit | awk '{print $2}' | sed 's/Rate=//'

This will return the data rate.

share|improve this answer
yes, im doing with this iwconfig wlan0 | grep Rate | cut -f 2 -d "=" | cut -f 1 -d " " now, but, still, it will be faster to read it from file ( if it is stored somewhere in decimal )then running iwconfig, grep,awk and sed ( or in my case 2x cut ) – Denwerko May 2 '11 at 16:52
I don't think there is another way of getting the bit rate value. You can probably, without any problems run the command over 100 times per second if you want to. – Alex May 2 '11 at 21:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.