bluetoothctl is bluetooth control tool which allows us to make the host discoverable, scan other devices, pair to the scanned devices and also connect to those devices using command line utility on ubuntu. Follow below commands for the same. Commands are self explanatory, replace scaned mac address of your device instead of “6C:C4:D5:6C:C5:BC” whereever required.

Architecture and Core Concepts

Implementation details $ bluetoothctl [NEW] Controller 70:1A:04:59:69:04 ubuntu-0 [default] [bluetooth]# list Controller 70:1A:04:59:69:04 ubuntu-0 [default] [bluetooth]# show 70:1A:04:59:69:04 Controller 70:1A:04:59:69:04 Name: laptop Alias: ubuntu-0 Class: 0x3c010c Powered: yes Discoverable: no Pairable: yes UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: IrMC Sync (00001104-0000-1000-8000-00805f9b34fb) UUID: Handsfree (0000111e-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb) UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb) UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb) UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0525 Discovering: no [bluetooth]# select 70:1A:04:59:69:04 [bluetooth]# power on Changing power on succeeded [bluetooth]# agent on Agent registered [bluetooth]# default-agent Default agent request successful [bluetooth]# discoverable on Changing discoverable on succeeded [CHG] Controller 70:1A:04:59:69:04 Discoverable: yes [bluetooth]# scan on Discovery started [CHG] Controller 70:1A:04:59:69:04 Discovering: yes [bluetooth]# devices [NEW] Device 6C:C4:D5:6C:C5:BC Nokia 7 plus [bluetooth]# pair 6C:C4:D5:6C:C5:BC Attempting to pair with 6C:C4:D5:6C:C5:BC [CHG] Device 6C:C4:D5:6C:C5:BC Connected: yes Request confirmation [agent] Confirm passkey 090015 (yes/no): yes [CHG] Device 6C:C4:D5:6C:C5:BC Modalias: bluetooth:v001Dp1200d1436 [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001103-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001105-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001106-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000110a-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000110c-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000110e-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001112-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001115-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001116-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000111f-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000112d-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 0000112f-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001132-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC UUIDs: 00001801-0000-1000-8000-00805f9b34fb [CHG] Device 6C:C4:D5:6C:C5:BC Paired: yes Pairing successful [CHG] Device 6C:C4:D5:6C:C5:BC Connected: no [bluetooth]# trust 6C:C4:D5:6C:C5:BC [CHG] Device 6C:C4:D5:6C:C5:BC Trusted: yes Changing 6C:C4:D5:6C:C5:BC trust succeeded [CHG] Controller 70:1A:04:59:69:04 Discoverable: no [bluetooth]# connect 6C:C4:D5:6C:C5:BC Attempting to connect to 6C:C4:D5:6C:C5:BC [CHG] Device 6C:C4:D5:6C:C5:BC Connected: yes Connection successful [Nokia 7 plus]# info Device 6C:C4:D5:6C:C5:BC Name: Nokia 7 plus Alias: Nokia 7 plus Class: 0x5a020c Icon: phone Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Dialup Networking (00001103-0000-1000-8000-00805f9b34fb) UUID: OBEX Object Push (00001105-0000-1000-8000-00805f9b34fb) UUID: OBEX File Transfer (00001106-0000-1000-8000-00805f9b34fb) UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb) UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb) UUID: Headset AG (00001112-0000-1000-8000-00805f9b34fb) UUID: PANU (00001115-0000-1000-8000-00805f9b34fb) UUID: NAP (00001116-0000-1000-8000-00805f9b34fb) UUID: Handsfree Audio Gateway (0000111f-0000-1000-8000-00805f9b34fb) UUID: SIM Access (0000112d-0000-1000-8000-00805f9b34fb) UUID: Phonebook Access Server (0000112f-0000-1000-8000-00805f9b34fb) UUID: Message Access Server (00001132-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) Modalias: bluetooth:v001Dp1200d1436 RSSI: -69 [Nokia 7 plus]# help Available commands: list List available controllers show [ctrl] Controller information select Select default controller devices List available devices paired-devices List paired devices power Set controller power pairable Set controller pairable mode discoverable Set cont

Execution Syntax and Code Implementation

Terminalbash
make the host discoverable, scan other devices, pair to the scanned devices and also connect to those devices using command line utility on ubuntu

Gotchas and Troubleshooting Checklist

  • Permission & Access Control - verify user privilege level (sudo access or file ownership) before running commands.

  • Environment & Path Resolution - confirm environment variables and binary PATH entries match target software releases.

  • Log Diagnostics - inspect relevant system logs or application trace outputs to verify clean execution.

Following these steps provides a clean, reliable, and production-ready solution for scan, pair, connect to bluetooth device from ubuntu from command line using bluetoothctl.