Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Get your Airport SSID from the commandline UNIX
Tiger only hintI used to get my Airport network's SSID using this Terminal command:
$ ioreg -n AirPortPCI -S -w 0 | fgrep -i  ssid |\
 sed 's#.*" = "##; s#"##'
I found this in the comments to an older hint, but it no longer seems to work in 10.4.2 (although I thought it worked in 10.4.1 and/or 10.4.0). However, this still works:
$ system_profiler SPAirPortDataType |
awk -F": " '/Current Wireless Network/{print $2}'
[robg adds: The new command worked when I tested it in 10.4.2; I had no luck with the older version, either.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[17,718 views]  

10.4: Get your Airport SSID from the commandline | 11 comments | Create New Account
Click here to return to the '10.4: Get your Airport SSID from the commandline' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Get your Airport SSID from the commandline
Authored by: foilpan on Aug 26, '05 10:18:20AM

what about using the new airport command line tool?

airport -I gives me this info.

no?



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: chabig on Aug 26, '05 11:07:29AM

Where did that come from? I don't have an airport command line tool on my virgin Tiger system.



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: merlyn on Aug 26, '05 11:08:03AM

localhost:~ % airport -I
zsh: command not found: airport
(Yes, the name of my box is "localhost". :-)

What version of OSX does this work on? Maybe it's OSX server only?

[ Reply to This | # ]

10.4: Get your Airport SSID from the commandline
Authored by: eightball on Aug 26, '05 11:23:44AM

The airport command is here:

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



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: Lankhmart on Aug 26, '05 11:27:04AM
The airport tool is located at:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport
as noted in this hint: Control a wireless card from the command line

[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: foilpan on Aug 26, '05 04:05:10PM

oh, right. i symlinked airport to that location like so:

/usr/local/bin/airport -> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport

totally forgot about that...



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: eamonc on Aug 26, '05 10:25:59AM

This command is also backward-compatible to 10.3, definitely a plus for script writers.



[ Reply to This | # ]
Related: get your Location
Authored by: pauljlucas on Aug 26, '05 11:42:17AM

For something slightly different, you can use the scselect command to get (or set) your current "Location" in the Apple Menu. "man scselect" for details.

---
- Paul



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: luomat on Aug 26, '05 03:21:59PM


I've often noticed that tip hints here include commands not found in $PATH

As soon as someone said "airport' I tried this:

locate / | grep "/airport$"

Do you ever get the feeling there are just an awful lot of cool tools hidden inside OS X that we don't know about until someone else mentions them?!



[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: LC on Aug 27, '05 01:37:15PM
I think this is a bit easier when doing that -- locate '/*/airport'
Larry

[ Reply to This | # ]
10.4: Get your Airport SSID from the commandline
Authored by: luomat on Jun 12, '06 01:36:38PM

BTW in case anyone doesn't have their locate database running, you can find the file here (at least in 10.4.6)

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

which I linked to /usr/local/bin like this

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

note that should be ALL ONE LINE



[ Reply to This | # ]