I already turned on my bluetooth by running sudo rfkill unblock bluetooth command on terminal.I want to turn on my blutooth visibility mode also, so that only my device will get detected.All i have to do from command-line.

How to turn on and off Bluetooth's visibility mode in Ubuntu 14.04 from command-line?


In BlueZ >= 5 command line control of a device can be done with btmgmt tool:

sudo btmgmt
[mgmt]# help         # list commands
[mgmt]# info         # list device(s)
[mgmt]# select hciX  # select a known device by index X eg. hci0
[hci0]# discov yes   # make hci0 visible/discoverable
[hic0]# discov no    # make hci0 invisible

In older version of BlueZ we can control our Bluetooth device with the command line tool hciconfig.

To enable visibility:

sudo hciconfig hciX piscan

To disable visibility:

sudo hciconfig hciX noscan

Replace hciX with your device (usually hci0)

To query your Bluetooth device(s):

sudo hciconfig -a
| improve this answer | |
  • 1
    perfect.Works dramastically :-) – Avinash Raj Apr 19 '14 at 16:27
  • @Takkat: For me, hci0 does not work. How to determine hciX? – Curious Sep 5 at 15:39
  • @Curious: see edit - does this help? – Takkat Sep 5 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.