Whether you are setting up an headless Raspberry Pi server, troubleshooting weak Wi-Fi connectivity in a remote Linux environment, or auditing local wireless security, scanning for nearby Wi-Fi Access Points (APs) from the command line is an indispensable skill.
Linux provides multiple command-line utilities for discovering wireless networks, ranging from high-level network managers (nmcli) to low-level kernel netlink interfaces (iw) and legacy Wireless Extensions (iwlist). In this article, we explore how to scan for available Wi-Fi networks, filter RSSI signal strength, and parse channel metrics across modern Linux distributions.
Wi-Fi Scanning Command Matrix
Choose the appropriate scanning utility based on your current Linux environment and subsystem:
`nmcli dev wifi list` (NetworkManager): Recommended for desktop Linux (Ubuntu, Fedora, Debian) and servers running NetworkManager. User-friendly tabular output showing active connection indicators (
*).`sudo iw dev wlan0 scan` (nl80211): Recommended for modern embedded Linux and kernel-level network inspection. Direct communication with the
cfg80211kernel subsystem via Netlink.`sudo iwlist wlan0 scan` (WEXT): Recommended for legacy systems, BusyBox environments, and older 3.x/4.x Linux kernels using Wireless Extensions.
Method 1: Scanning Access Points using nmcli
The NetworkManager CLI (nmcli) is the fastest and most readable way to list wireless networks on desktop and server installations:
# 1. Force NetworkManager to trigger a fresh background Wi-Fi scan
sudo nmcli dev wifi rescan
# 2. Display formatted table of discovered Wi-Fi Access Points
nmcli dev wifi list
# Sample Output:
# IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY
# * AA:BB:CC:11:22:33 Office_5G Infra 36 540 Mbit/s 92 ▂▄▆█ WPA2 WPA3
# DD:EE:FF:44:55:66 Guest_Network Infra 6 130 Mbit/s 65 ▂▄▆_ WPA2
# 3. Output only specific fields (ideal for automated shell scripts)
nmcli -f SSID,BSSID,SIGNAL,CHAN,SECURITY dev wifi listMethod 2: Low-Level Kernel Scanning using iw (nl80211)
On systems without NetworkManager (such as minimal Yocto images or Alpine Linux), use the iw tool to communicate directly with the Linux kernel wireless subsystem (cfg80211):
# 1. Identify wireless interface name (e.g. wlan0 or wlp2s0)
iw dev
# 2. Trigger active probe request scan on interface wlan0
sudo iw dev wlan0 scan
# 3. Filter scan output for SSID names, BSSIDs, frequencies, and RSSI signal levels
sudo iw dev wlan0 scan | grep -E "BSS|SSID|signal|freq:"Method 3: Legacy Scanning using iwlist
For older Linux deployments using legacy Wireless Extensions (WEXT), use iwlist from the wireless-tools package:
# Scan for wireless cells on interface wlan0 and extract ESSID names and signal levels
sudo iwlist wlan0 scan | grep -E "ESSID|Signal level|Frequency|Address"Understanding Wi-Fi Scan Metrics: RSSI and Frequencies
SSID (Service Set Identifier): The human-readable name of the wireless network.
BSSID (Basic Service Set Identifier): The 48-bit MAC address of the specific radio transceiver emitting the beacon frame.
RSSI / Signal Power (dBm): Measured in negative dBm values.
-30 dBmrepresents near-perfect signal strength;-67 dBmis the minimum threshold for reliable video streaming;-80 dBmindicates weak signal susceptible to packet loss.Channel Frequencies:
2412 MHzto2484 MHzrepresent 2.4 GHz channels (channels 1-14);5180 MHzto5825 MHzrepresent 5 GHz channels.
Troubleshooting Common Wireless Scanning Failures
`No Wi-Fi interface found`: Verify your Wi-Fi driver is loaded into the kernel using
lsmod | grep -i wlanor checkdmesg | grep -i firmwarefor missing wireless firmware blobs.`Device or resource busy` (`-EBUSY`): Occurs when a background process (such as
wpa_supplicantorhostapdin AP mode) locks the radio interface. Stop conflicting services before initiating a manual scan.Hidden SSIDs Not Appearing: Access Points with SSID broadcasting disabled will report empty string names (
SSID: ""). Useiwactive scanning targeting specific SSIDs if required.
Comments and corrections