Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 78823  / 3 Years ago, wed, july 21, 2021, 4:31:55

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?


More From » wireless

 Answers
5

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 :)).


[#29344] Wednesday, July 21, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enefiama

Total Points: 43
Total Questions: 125
Total Answers: 102

Location: Gabon
Member since Sat, Jul 25, 2020
4 Years ago
enefiama questions
;