Control a wireless card from command line

Jul 25, '05 08:21:00AM

Contributed by: atverd

There is an officially supported, but well hidden by Apple, method of controlling supported wireless cards from command line. It doesn't look like this tool was mentioned here before, and I think it may be useful for many.

The tool is called airport (what a surprise!), and it's hiding in /System -> Library -> PrivateFrameworks -> Apple80211.framework -> Versions -> A -> Resources. It appeared there after one of the Panther updates, and Apple has actually been slowly improving it since then; it's really functional. Just go to that directory and launch it in Terminal (no root privileges required) like this:

$ ./airport -h
and you'll see all the available options. It can scan for broadcasting networks (-s), or for a hidden one if you know it's name (-sNAME). It can associate you with a network (-A), show you status of your card, and many other good things. I created a soft link for easy access to this little gem, and if you have admin privileges, you can make one like this:
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.\
framework/Versions/A/Resources/airport /usr/bin
Enjoy!

Comments (12)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050715001815547