Is there a way to get BSSID and the list of available Wi-Fi networks from within Terminal?

I.e. I'm looking for something similar to ifconfig run0 scan on OpenBSD, which lists all access points, BSSID, signal strength etc.


There's an airport utility buried that you'll want to use. Create a symbolic link in /usr/local/bin to the utility for quick access with this command:

sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport

Now, you should be able to run airport -s and get a list of available networks with BSSIDs.

If you hold the option key while opening the WiFi networks in the Menu Bar, you can also see the BSSIDs one at a time, although it seems like you wanted the CLI-like version from OpenBSD.


"rootless" AKA System Integrity Protection (SIP) has been added to OSX since I wrote this answer originally, which makes /usr/bin and /usr/sbin read-only. It is proper to use /usr/local/bin, so I have updated the answer so that the symbolic link is created there.

  • 4
    Better than creating a symlink would likely be to create an alias in your shell initialization. alias airport="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport" Doesn't need sudo privileges hence is available for non-admin users alike and doesn't affect other users. – MacLemon Feb 6 '13 at 18:55
  • 1
    1) "Better" is relative. If you are the only user of a Mac, then non-admin users and other users are not a concern, and having the command linked somewhere in your $PATH which means you can use it in other scripts and shells (although I'd opt to link it to /usr/local/bin/). 2) The airport command has been at that path at least since 10.6 and possibly earlier, for people who are concerned about backwards compatibility. It is still there in 10.8 as well. – TJ Luoma Feb 13 '13 at 22:32
  • I suggested the symbolic link for the same reason TJ suggested, because you have got to have it linked to your $PATH, so I figured maybe the symbolic link would be less likely to give issues. Plus, many users do not use (or know how to use) .profile or .bash_profile. Both solutions work perfectly well :) – sofly Feb 14 '13 at 2:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .