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?
Best Answer
Running the following command in terminal:
will open a window for network management which should be similar with:
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:
The above window will be changed automatically to:
As you can see, now "Airplane Mode" is on and the wireless is off.
Running, again in terminal, the following command:
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 alsoman nmcli
) it's enough and can be executed by any usual user... You don't need root privileges to climb in an airplane :)).