Listing all available WIFI access points can be a hassle on Linux, but iwlist makes this very easy. It can be used to list verbose information about any WIFI access points that are near you.
Used as root, it will list comprehensive information about each access point.
Cell 08 - Address: 10:13:31:22:30:41 Channel:11 Frequency:2.462 GHz (Channel 11) Quality=31/70 Signal level=-79 dBm Encryption key:on ESSID:"Definitely not ASIO" 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 Extra:tsf=000000b6d4c6ac53 Extra: Last beacon: 384ms ago IE: Unknown: 0013446566696E6974656C79206E6F74204153494F IE: Unknown: 010882848B9624B0486C IE: Unknown: 03010B IE: Unknown: 2A0100 IE: Unknown: 32048C129860 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK IE: Unknown: 46053208010000 IE: Unknown: 2D1A1C081BFFFF000000000000000000000000000000000000000000 IE: Unknown: 3D160B080400000000000000000000000000000000000000 IE: Unknown: 4A0E14000A002C01C800140005001900 IE: Unknown: 7F080500080000400040 IE: Unknown: DD9E0050F204104A0001101044000102103B000103104700103E93D92E94C5592B96B810080454980E1021000B546563686E69636F6C6F721023000E4D6564696141636365737320544710240009373839766163207632104200093137303353414345411054000800060050F2040001101100174D6564696141636365737320544737383976616320763210080002268C103C0001031049000600372A000120 IE: Unknown: DD090010180201000C0000 IE: Unknown: DD180050F2020101040003A4000027A4000042435E0062322F00 |
But this is overwhelming when looking for certain info. But grep can help with this. The example below, is just returning a listing of all WIFI access points around the user.
4.4 Wed Feb 20 jason@Yog-Sothoth 0: $ sudo iwlist wlx000da32609b6 scan | grep ESSID ESSID:"OPTUS_B8E926" ESSID:"STUTIEVA" ESSID:"Telstra962013" ESSID:"Telstra Air" ESSID:"Fon WiFi" ESSID:"Catherine" ESSID:"TelstraD22F23" ESSID:"Definitely not ASIO" |
Listing all Frequencies of the access point.
This example is listing all of the signal strength values for each access point.
4.4 Wed Feb 20 jason@Yog-Sothoth 0: $ sudo iwlist wlx000da32609b6 scan | grep "Signal level" | awk '{ print $3 }' | cut -d "=" -f 2 -81 -75 -77 -77 -81 -67 -69 -67 |
How to list all of the MAC addresses in the output. This could be very useful.
4.4 Wed Feb 20 jason@Yog-Sothoth 0: $ sudo iwlist wlx000da32609b6 scan | grep "Address:" | cut -d : -f 2,3,4,5,6,7,8 E4:FB:5D:AB:B8:5C F8:AB:05:96:20:19 FA:AB:05:96:20:1A FA:AB:05:96:20:1B F4:6B:EF:B8:E9:27 5C:A8:6A:12:78:28 10:13:31:D2:2F:23 10:13:31:22:30:41 |
Finally, this is how to list all ESSID entries, with no ” characters.
4.4 Wed Feb 20 jason@Yog-Sothoth 0: $ sudo iwlist wlx000da32609b6 scan | grep "ESSID:" | cut -d : -f 2,3,4,5,6,7,8 | tr -d '"' STUTIEVA TelstraD22F23 OPTUS_B8E926 Telstra962013 Telstra Air Fon WiFi Catherine |
The tr -d '"'
command deletes a defined character in a string. Very useful indeed. And this cut -d : -f 2,3,4,5,6,7,8
is to only print certain columns of text. This is very useful in this context, I can create a nice one-liner very easily. And get the information I want with no fuss.