Find bluetooth interface
Identify bluetooth controller interfaces and inspect their kernel and management-layer details.
List Bluetooth controller names using btmgmt
Extract Bluetooth controller identifiers from btmgmt output
Inspect debug information for a Bluetooth controller
hr() {
printf -v _hr "%*s" "$(tput cols 2>/dev/null || echo 80)" ""
echo "${_hr// /-}"
}
# Pick a readable-ish random 256-color (avoid very dark low numbers)
rand_color() { printf '%s' $(( 16 + RANDOM % 216 )); }
find /sys/kernel/debug/bluetooth/hci0 -maxdepth 1 -type f -print0 \
| sort -z \
| while IFS= read -r -d '' f; do
c=$(rand_color)
esc=$'\033'
# Set color
printf '%s[38;5;%sm' "$esc" "$c"
hr
printf '%s\n' "$f"
hr
sed 's/^/ /' "$f"
printf '%s[0m\n\n' "$esc" # reset + blank line
done