How to determine out what Wi-Fi channel is used from the command line?
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


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!)
&gt; alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
Then you can run this command to find out more info: &gt; airport en1 scan