Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

If I hold Alt/Option and click the Airport icon at the top, I get a bunch of extra data about the access point I'm connected to.

Most interestingly for me right now is the Wi-Fi channel. ifconfig doesn't seem to include it.

How can I get this same info from the command line?

share|improve this question
1  
Exact duplicate of superuser.com/questions/323548/…. –  JRobert Aug 15 '11 at 19:30
add comment

3 Answers

up vote 2 down vote accepted

Try running system_profiler SPAirPortDataType from the command line - that will probably give you all the info you need. It's not terribly speedy though (just checked it with Lion, looks like the format has changed but it's still all there).

share|improve this answer
add comment

There is a command line airport that is buried deep in the system framework that seems to be safe to call from the terminal. You can make a quick shell alias if you prefer short commands.

From macworld

  1. Create an alias in your ~/.profile for the Airport Utility:
    (this should all be on the same line with NO SPACE between airport='..., but it won't fit on one here!)
    > alias
    airport=
    '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/
    airport'

  2. Then you can run this command to find out more info:
    > airport en1 scan

share|improve this answer
3  
You should not be dropping things into /usr or /usr/bin. Create your own ~/bin directory, or create /usr/local/bin. –  zzz Aug 15 '11 at 19:06
    
Changed it. That is the way I would have done it anyway. –  afuzzyllama Aug 15 '11 at 19:09
    
It gets my vote. –  zzz Aug 15 '11 at 19:14
    
Thanks but scan doesn't show which network I'm connected to. It shows all available networks and their strengths, but I'm not necessarily on the strongest. –  Leopd Aug 15 '11 at 20:44
2  
You might try 'airport -I' –  zzz Aug 15 '11 at 21:56
add comment

In Mountain Lion try

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I

To see other options use

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -help
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.