Run nm-tool | grep \*. That should show just the line with the SSID you are connected to.
Edit: The nm-tool utility had ceased to exist, so in 16.04 and newer releases, please use any of the methods suggested by my esteemed colleagues below.
For example: nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d\' -f2 works well.
Although the question has already been answered, the iwconfig tool does display the ESSID of the currently connected Wifi network. Perhaps it does not work with connections managed through NetworkManager but it works with interfaces managed through ifup/ifdown:
shows the same output without listing all available SSIDs in vicinity so without delay.
if more network interfaces are available and active can be parsed by interface name like so:
iwgetid
provides the ssidiwgetid -r
gives just the name.In a Bash script try something like
myssid=$(iwgetid -r)
to put it in a variableRun
nm-tool | grep \*
. That should show just the line with the SSID you are connected to.Edit: The
nm-tool
utility had ceased to exist, so in 16.04 and newer releases, please use any of the methods suggested by my esteemed colleagues below.For example:
nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d\' -f2
works well.Although the question has already been answered, the iwconfig tool does display the ESSID of the currently connected Wifi network. Perhaps it does not work with connections managed through NetworkManager but it works with interfaces managed through ifup/ifdown:
lists:
None of the prior answers worked for me unfortunately. I was however able to get the details via
and got
You can also use the
iw
tool (from the iw package) to obtain the WiFi link parameters which includes the currently associated SSID - e.g for wlan0:shows the same output without listing all available SSIDs in vicinity so without delay. if more network interfaces are available and active can be parsed by interface name like so:
simply use this command to get only the ssid "NAME"
Where
wlan0
is the interface for your Wi-Fi card. Check it inifconfig
oriwconfig
.The output is only the "ssid name" of the network you connected...