“Airplane Mode” in OS X. Alternative command for `rfkill`? Mac OS X doesn't recognize rfkill from its terminal, and I am looking for an alternative command that has similar functionality (toggling "Airplane Mode").

NOTE: I don't wish to open an .app to toggle. I'd like to execute the command from command line or within script in Bash (or equivalents).



By "Airplane Mode", I meant to borrow the term from iOS support page here. I would like to disable all incoming/outgoing network communications from my system.
Make an ad hoc location named isolated or airplane where all the network interfaces are present and turned off.

Switch to this deaf location with:

networksetup -switchtolocation isolated


It might be more interesting than rfkill since you can protect you
from an unnoticed Ethernet cable which might be listening to all your
communications (and they are a lot) :[.
To check that everything is really off, run:

ifconfig -a | grep '[&lt;,]UP[,&gt;]' | grep -v '[&lt;,]LOOPBACK[,&gt;]'


If this command doesn't display anything, then all your interfaces are down, everything is OK.

If this command output anything, as here:

en1: flags=8863&lt;UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST&gt; mtu 1500


then it means that the interface name (here en1 which is the wireless
one on this Mac)
is on where it shouldn't. This is the sign that either the configuration made is failing or that some Trojan horse turned it on to reach its control server via the Internet.