Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the terminal command to turn Airplane Mode on/off in Ubuntu?

Is it simply sudo rfkill block all and sudo rfkill unblock all? I know that this will disable all wireless modules in the computer, but will this be noticed by the system, so that Airplane Mode is toggled off/on in network settings?

share|improve this question
Try sudo rfkill unblock wifi – Mitch Sep 21 '13 at 9:57
@Mitch Do we really need root privileges to climb in an airplane? – Radu Rădeanu Sep 21 '13 at 10:54
@RaduRădeanu With all the security issues at airports sure :) lol – Mitch Sep 21 '13 at 11:18
up vote 3 down vote accepted

Running the following command in terminal:

gnome-control-center network

will open a window for network management which should be similar with:

Airplane mode on

You can observe that at this moment the "Airplane Mode" is off and the wireless is on.

Now, without to close this window, run the following command in terminal:

nmcli nm wifi off

The above window will be changed automatically to:

Airplane mode on

As you can see, now "Airplane Mode" is on and the wireless is off.

Running, again in terminal, the following command:

nmcli nm wifi off

will turn "Airplane Mode" off and wireless on again.

So, you don't need rfkill (which need also root privileges) to toggle "Airplane Mode" via terminal.

nmcli (see also man nmcli) it's enough and can be executed by any usual user... You don't need root privileges to climb in an airplane :)).

share|improve this answer
Great answer. Thank you. – lindhe Sep 21 '13 at 11:55
nmcli nm wifi off does not turn off airplane mode unless bluetooth is off. – kzh Dec 28 '14 at 17:27
For 15.04 it would be: nmcli r all off and nmcli r all on. Or to include bluetooth: rfkill block bluetooth & rfkill block wlan and rfkill unblock bluetooth & rfkill unblock wlan . – VRR Jul 26 '15 at 12:42
For 15.04 (with updates) I found this to work best: alias wifitoggle='nmcli r wifi off ; sleep 1 ; nmcli r wifi on' – Alan Thompson Oct 20 '15 at 23:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.