Turn Airplane Mode on/off via terminal
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?
wireless bluetooth
add a comment |
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?
wireless bluetooth
Trysudo 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
add a comment |
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?
wireless bluetooth
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?
wireless bluetooth
wireless bluetooth
edited Nov 1 '13 at 19:47
asked Sep 21 '13 at 9:42
lindhe
3353722
3353722
Trysudo 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
add a comment |
Trysudo 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
Try
sudo rfkill unblock wifi
– Mitch♦
Sep 21 '13 at 9:57
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
@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
@RaduRădeanu With all the security issues at airports sure :) lol
– Mitch♦
Sep 21 '13 at 11:18
add a comment |
2 Answers
2
active
oldest
votes
Running the following command in terminal:
gnome-control-center network
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:
nmcli nm wifi off
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:
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 :)).
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.
– kzh
Dec 28 '14 at 17:27
1
For 15.04 it would be:nmcli r all off
andnmcli r all on
. Or to include bluetooth:rfkill block bluetooth & rfkill block wlan
andrfkill 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
add a comment |
For Ubuntu 18.04:
nmcli r wifi on
turns airplane mode off, and the converse is true.
A simple bash script to toggle airplane mode on or off is below; save it to file and set its execute bit in properties.
#!/bin/bash
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')
if [ "$wifi" == "enabled" ]
then
nmcli r wifi off
else
nmcli r wifi on
fi
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f348262%2fturn-airplane-mode-on-off-via-terminal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Running the following command in terminal:
gnome-control-center network
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:
nmcli nm wifi off
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:
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 :)).
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.
– kzh
Dec 28 '14 at 17:27
1
For 15.04 it would be:nmcli r all off
andnmcli r all on
. Or to include bluetooth:rfkill block bluetooth & rfkill block wlan
andrfkill 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
add a comment |
Running the following command in terminal:
gnome-control-center network
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:
nmcli nm wifi off
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:
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 :)).
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.
– kzh
Dec 28 '14 at 17:27
1
For 15.04 it would be:nmcli r all off
andnmcli r all on
. Or to include bluetooth:rfkill block bluetooth & rfkill block wlan
andrfkill 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
add a comment |
Running the following command in terminal:
gnome-control-center network
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:
nmcli nm wifi off
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:
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 :)).
Running the following command in terminal:
gnome-control-center network
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:
nmcli nm wifi off
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:
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 :)).
answered Sep 21 '13 at 10:51
Radu Rădeanu
116k34246322
116k34246322
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.
– kzh
Dec 28 '14 at 17:27
1
For 15.04 it would be:nmcli r all off
andnmcli r all on
. Or to include bluetooth:rfkill block bluetooth & rfkill block wlan
andrfkill 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
add a comment |
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.
– kzh
Dec 28 '14 at 17:27
1
For 15.04 it would be:nmcli r all off
andnmcli r all on
. Or to include bluetooth:rfkill block bluetooth & rfkill block wlan
andrfkill 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
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.– kzh
Dec 28 '14 at 17:27
nmcli nm wifi off
does not turn off airplane mode unless bluetooth is off.– kzh
Dec 28 '14 at 17:27
1
1
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 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
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
add a comment |
For Ubuntu 18.04:
nmcli r wifi on
turns airplane mode off, and the converse is true.
A simple bash script to toggle airplane mode on or off is below; save it to file and set its execute bit in properties.
#!/bin/bash
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')
if [ "$wifi" == "enabled" ]
then
nmcli r wifi off
else
nmcli r wifi on
fi
add a comment |
For Ubuntu 18.04:
nmcli r wifi on
turns airplane mode off, and the converse is true.
A simple bash script to toggle airplane mode on or off is below; save it to file and set its execute bit in properties.
#!/bin/bash
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')
if [ "$wifi" == "enabled" ]
then
nmcli r wifi off
else
nmcli r wifi on
fi
add a comment |
For Ubuntu 18.04:
nmcli r wifi on
turns airplane mode off, and the converse is true.
A simple bash script to toggle airplane mode on or off is below; save it to file and set its execute bit in properties.
#!/bin/bash
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')
if [ "$wifi" == "enabled" ]
then
nmcli r wifi off
else
nmcli r wifi on
fi
For Ubuntu 18.04:
nmcli r wifi on
turns airplane mode off, and the converse is true.
A simple bash script to toggle airplane mode on or off is below; save it to file and set its execute bit in properties.
#!/bin/bash
wifi="$(nmcli r wifi | awk 'FNR = 2 {print $1}')
if [ "$wifi" == "enabled" ]
then
nmcli r wifi off
else
nmcli r wifi on
fi
answered Dec 27 '18 at 7:09
DrMoishe Pippik
1185
1185
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f348262%2fturn-airplane-mode-on-off-via-terminal%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
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