Show BSSID of an access point?
If I'm not mistaken, it should be the Address shown when issuing
sudo iwlist scanning
E.g.:
wlan0 Scan completed :
Cell 01 - Address: 00:11:22:33:44:55
Channel:5
Frequency:2.432 GHz (Channel 5)
Quality=70/70 Signal level=-33 dBm
Encryption key:on
ESSID:"the_known_ssid"
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
24 Mb/s; 36 Mb/s; 54 Mb/s
Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
Mode:Master
...
If using network manager (the default in Ubuntu), you can use nmcli
. It also has several options for the output format.
In your case, where you know the SSID and want the BSSID :
nmcli -f SSID,BSSID,ACTIVE dev wifi list | grep $wanted_ssid