3 Methods to Get Bluetooth MAC Address in Linux

3 Methods to Get Bluetooth MAC Address in Linux

A Bluetooth MAC (Media Access Control) address is a unique 48-bit value assigned to a Bluetooth device by the manufacturer to uniquely identify it.

This tutorial provides 3 methods how to get Bluetooth MAC address in the Linux. Commands have been tested on Raspberry Pi OS.

Method 1 - hcitool command

The hcitool command can be used to configure Bluetooth connections. The following command prints the MAC address of the Bluetooth device:

hcitool dev | cut -sf3

Output example:

DC:A6:32:A1:C6:45

Method 2 - hciconfig command

The hciconfig command can be used to configure Bluetooth devices. To print Bluetooth MAC address, use the following command:

hciconfig | grep 'BD Address' | cut -d' ' -f3

Method 3 - hci0/identity file

It is possible to read hci0/identity file which contains MAC address of the Bluetooth device:

sudo cat /sys/kernel/debug/bluetooth/hci0/identity | cut -d' ' -f1

Leave a Comment

Cancel reply

Your email address will not be published.