How to handle Bluetooth devices from shell

Bluetooth devices can be listed, connected and disconnected by clicking the Bluetooth icon in the top Panel in the Ubuntu Unity desktop. If you prefer to do these simple operations from the commandline, that can be done too.

To do this, we need the tools from the bluez-tools package:

$ sudo apt install bluez-tools

To list all the devices that have paired in the past:

$ bt-device --list

This lists each device with its name and UUID. The UUID of a device can be used to connect or disconnect from it.

To connect an audio device using its UUID, say 00:02:3C:2F:F1:D4:

$ bt-audio --connect 00:02:3C:2F:F1:D4

To disconnect the same audio device:

$ bt-audio --disconnect 00:02:3C:2F:F1:D4

Tried with: Bluez-tools 0.1.38 and Ubuntu 14.04

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s