hostnamectl; # tested on
Icon name: computer-desktop
Chassis: desktop
Operating System: Debian GNU/Linux 10 (buster)
Kernel: Linux 4.19.0-8-amd64
Architecture: x86-64

su - root; # become root

apt update
apt install rfkill
rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

rfkill block wifi
rfkill list
0: phy0: Wireless LAN
	Soft blocked: yes
	Hard blocked: no

when soft blocked, the device will be not available to network manager of gnome desktop.

block index|type

Disable the device corresponding to the given index. type is one of „all“, „wifi“, „wlan“, „bluetooth“, „uwb“, „ultrawideband“, „wimax“, „wwan“, „gps“ or „fm“.

unblock index|type

Enable the device corresponding to the given index. If the device is hard-blocked, e.g. via a hardware switch, it will remain unavailable though it is now soft-unblocked.

authors

rfkill was originally written by Johannes Berg <johannes[:at:]sipsolutions[:dot:]net> and Marcel Holtmann <marcel[:at:]holtmann[:dot:]org>.

This manual page was written by Darren Salt <linux[:at:]youmustbejoking.demon.co[:dot:]uk>, for the Debian project (and may be used by others).

manpages:

rfkill.man.txt

links:

http://www.linux-commands-examples.com/rfkill

admin