The Computer Oracle

How to determine the WiFi channel from Mac command line?

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Magic Ocean Looping

--

Chapters
00:00 How To Determine The Wifi Channel From Mac Command Line?
00:29 Accepted Answer Score 16
01:22 Thank you

--

Full question
https://superuser.com/questions/323548/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#macos #mac #wirelessnetworking #commandline

#avk47



ACCEPTED ANSWER

Score 16


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