Ubuntu controlling network adapters through terminal

We all know that Ubuntu's network management is quite good but not there yet. One big issue with it is that, on some machines, disabling one type of network adapter, disables the other one too.

Like I use wifi to connect to the internet but my bluetooth is switched on by default all the time. And if I try to disable bluetooth it disables wifi too.

To control them via terminal or command line, you can do this (Atleast from Ubuntu 10.10 onwards):

ashfame@ashfame-xps:~$ rfkill list all
0: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
4: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no

You see how it says soft blocked & hard blocked. Soft block is a switch in OS & hard block is a hardware switch in your machine.

You can disable the ones you don't want by:

rfkill block bluetooth

and enable the ones you want by:

rfkill unblock wifi

Disabling the ones you don't want will save you some battery if you are on a laptop/notebook/ultrabook.

About Ashfame

Developer + Entrepreneur + Opensource fanatic. Love WordPress + Startups + Music + Adrenaline kick.