Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

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. –  Lindh-E Sep 21 '13 at 11:55

Your Answer

 
discard

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.