Skip to content

Instantly share code, notes, and snippets.

@tatethurston
Last active January 1, 2025 20:39
Show Gist options
  • Save tatethurston/eba5c87486d3036bdc55d27d7d29c751 to your computer and use it in GitHub Desktop.
Save tatethurston/eba5c87486d3036bdc55d27d7d29c751 to your computer and use it in GitHub Desktop.
replacement for airport wifi scanning
system_profiler SPAirPortDataType | awk '
BEGIN { printf "%-30s %-10s %-5s\n", "SSID", "Channel", "Signal" }
/Other Local Wi-Fi Networks:/ { start = 1; next }
/:/ {
if (start == 0 ) { next }
if (block == 0) {
ssid = $0
gsub(":", "", ssid)
gsub(/^ +/, "", ssid)
gsub(/ /, "", ssid)
block = 1
}
}
/Channel/ { channel = $2 }
/Signal/ { signal = $4 }
/Signal/ {
printf "%-30s %-10s %-5s\n", ssid, channel, signal
block = 0
}' | sort -k3nr
@tatethurston
Copy link
Author

SSID                           Channel    Signal
smithluna                      48         -64
BonoNetwork                    153        -67
Luluhome                       6          -67
GTZ                            2          -68
1565Greenwich                  6          -69
DunkinDonuts                   8          -69
Wifi123                        6          -69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment