Manage the Apple AirPort interface.
Syntax
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport options
The airport command is not in the system path by default, but you can create a symbolic link in /usr/local/bin:
$ sudo mkdir -p /usr/local/bin
$ sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/local/bin/airport
Options
-c[arg]
--channel=[arg] Set arbitrary channel on the card.
-z
--disassociate Disassociate from any network.
-I
--getinfo Print current wireless status, e.g. signal info, BSSID, port type etc.
-s[arg]
--scan=[arg] Perform a wireless broadcast scan.
Will perform a directed scan if the optional arg is provided.
-x
--xml Print info as XML
-P
--psk Create PSK from specified pass phrase and SSID.
The following additional arguments must be specified with this command:
--password=arg Specify a WPA password.
--ssid=arg Specify SSID when creating a PSK.
-h
--help Show this help.
Examples
Print the current wireless status:
$ airport -i
Print the full help for airport:
$ airport -h
“Rumack: Can you fly this plane, and land it?
Ted Striker: Surely you can't be serious.
Rumack: I am serious... and don't call me Shirley” - Airplane the movie
Related macOS commands:
ifconfig - Configure network interface parameters