Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

I tried $iwconfig | grep wlan0 but all I got was the line that my connected ESSID name exists. But I need only the name.

How do I get just the name?

share|improve this question

I don't know if this is the best solution, but try this:

For the essid name:

iwconfig wlan0 2> /dev/null | awk -F\" '{print $2}'

For the access point mode (as requested in the comment):

iwconfig wlan0 2> /dev/null | awk -F: '/Mode:/ {print $2}' | awk '{print $1}'

For the link Quality (as requested in the comment):

iwconfig wlan0 2> /dev/null | awk -F= '/Quality/ {print $2}' | awk '{print $1}'

For the channel, (as requested in the comment) try this:

sudo iwlist wlan0 scanning essid ESSID | grep Channel | head -1 | awk -F: '{print $2}'

Make sure to replace ESSID with your essid:

For the address, (as requested in the comment) try this:

ifconfig wlan0 2> /dev/null | awk -F: '/inet\ addr/ {print $2}' | awk '{print $1}'
share|improve this answer
That's perfect. – Ibrahim Nov 4 '12 at 19:20
Can you help me to find another informations. (channel connection,mode of my Access Point,Quality, – Ibrahim Nov 4 '12 at 19:36
yeah, sure, ill add them to the answer above, i'm about to leave now, but ill add them later on – Sam Nov 4 '12 at 19:50
all worked except the channel's coomand – Ibrahim Nov 4 '12 at 20:27
My bad, make sure to replace "ESSID" with your own essid! – Sam Nov 5 '12 at 2:03

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.