Rfkill is a tool for enabling and disabling wireless devices. Using “rfkill list” command we first check the list of available wireless devices supported in our hardware as,
$ rfkill list
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
1: brcmwl-0: Wireless LAN
Soft blocked: no
Hard blocked: no
3: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
As seen above we have a WiFi, LAN and Bluetooth supported and ON in my laptop. Now lets try turning ON & OFF this Bluetooth device using rfkill as,
Turn OFF Bluetooth
$ rfkill block bluetooth
Or using “rfkill index” bluetooth can be turned off as,
$ rfkill block 3
Now, as we can see in “rfkill list” Bluetooth is now turned OFF,
$ rfkill list
3: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
Turn ON Bluetooth
$ rfkill unblock bluetooth
OR using “rfkill list” index,
$ rfkill unblock 3