How to Show Available WiFi Networks on Linux from the Command Line
linuxuprising.com
linuxuprising.com
From their github:
horst is a small, lightweight IEEE802.11 WLAN analyzer with a text interface. Its basic function is similar to tcpdump, Wireshark or Kismet, but it's much smaller and shows different, aggregated information which is not easily available from other tools. It is made for debugging wireless LANs with a focus on getting a quick overview instead of deep packet inspection and has special features for Ad-hoc (IBSS) mode and mesh networks. It can be useful to get a quick overview of what's going on all wireless LAN channels and to identify problems.
sudo iw dev $IFACE scan
on a system running wpa_supplicant (e.g. through NetworkManager). Every so often you'll get a "Device busy" error because wpa_supplicant is scanning already. iwlist wlan0 scan | awk -F: '
BEGIN {
printf "%-40s | %3s | %5s | %4s\n", "SSID", "Enc", "Qual", "Chan"
}
function print_network() {
printf "%-40s | %3s | %5s | %4s\n", essid, key, quality, channel
}
/^[[:space:]]*Cell [0-9]+/ { if (key) { print_network() } }
/^[[:space:]]*Channel:/ { channel=$2 }
/^[[:space:]]*Encryption key:/ { key=$2 }
/^[[:space:]]*ESSID:/ { essid=$2 }
/^[[:space:]]*Quality=/ {
match($0, /[0-9]+\/[0-9]+/)
quality=substr($0, RSTART, RLENGTH)
}
END { print_network() }'Then I had a problem with wicd - interface issues caused by the deprecation of ifconfig in favor of "ip" tools (Debian). Wicd is a set of Python scripts that call ifconfig.
So I submitted a patch to fix my issue, and tied it to the multiple bug requests already reporting the issue...
Wicd hasn't been updated in years though. With ifconfig starting to break (at least in some situations) it's going to need some updates soon.
I switched back to nm and found it's working extremely well these days.
The output from nmcli is quite pretty to boot!
nmcli c my-wifi up
When you know you want to connect to a Wi-Fi network you know is in range. Also, nmtui doesn't support "enterprise" Wi-Fi (PEAP, for eduroan, for instance).