How to determine the WiFi channel from Mac command line?
There is an airport
info utility that comes with Apple's 802.11 framework. It is a bit hidden though. If you want to call it without specifying the path every time, enter the following into the Terminal to link this utility somewhere you can call it from the PATH:
sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/bin/airport
Then you call it from anywhere. Just enter airport
for a list of options.
airport -I
This would output:
charon:Resources werner$ airport -I
agrCtlRSSI: -56
agrExtRSSI: 0
agrCtlNoise: -86
agrExtNoise: 0
state: running
op mode: station
lastTxRate: 78
maxRate: 144
lastAssocStatus: 0
802.11 auth: open
link auth: wpa2-psk
BSSID: 0:23:69:14:ad:5c
SSID: Supersaurus
MCS: 12
channel: 1
To get the channel only, pipe into grep
:
airport -I | grep channel