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
hcitool command can be used to configure Bluetooth connections. The following command prints the MAC address of the Bluetooth device:
hcitool dev | cut -sf3
Method 2 - hciconfig command
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