45

I am looking for a way to check to see if the bluetooth is enabled or disabled on my laptop via the terminal. Is there a command that I can use to find this information

1

6 Answers 6

40

In addition to checking for the service you can use the command

hcitool dev

that will return all devices turned on.

2
  • I suppose I needed to word my question better. This answer provides me with what I need. With this I can see if my device is on or off based on whether or not it shows up. Thank you for your reply. May 31, 2012 at 16:03
  • 2
    hcitool con worked for me.
    – Kira
    Feb 12, 2020 at 14:38
20

More information with hciconfig -a

hciconfig -a provides way more information, including the Bluetooth version.

$ hciconfig -a
hci0:   Type: Primary  Bus: USB
    BD Address: 00:1A:7D:DC:70:13  ACL MTU: 310:10  SCO MTU: 64:8
    UP RUNNING PSCAN 
    RX bytes:1013 acl:0 sco:0 events:60 errors:0
    TX bytes:4890 acl:0 sco:0 commands:60 errors:0
    Features: 0xff 0xff 0x8f 0xfe 0xdb 0xff 0x5b 0x87
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
    Link policy: RSWITCH HOLD SNIFF PARK 
    Link mode: SLAVE ACCEPT 
    Name: 'hostname'
    Class: 0x1c0104
    Service Classes: Rendering, Capturing, Object Transfer
    Device Class: Computer, Desktop workstation
    HCI Version: 4.0 (0x6)  Revision: 0x22bb
    LMP Version: 4.0 (0x6)  Subversion: 0x22bb
    Manufacturer: Cambridge Silicon Radio (10)
18

Just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, You can run this command to see the status of bluetooth

sudo service bluetooth status

after you enter your password, you should see something like

bluetooth is running

4
  • 6
    Regardless of whether or not the bluetooth is on i get the same message from that command: bluetooth start/running, process 1132 May 31, 2012 at 15:55
  • The Bluetooth icon disappeared.I get the following message. Can anyone please help me what this mean? Mar 9, 2022 at 12:35
  • ashoke@Dell-3470:~$ sudo service bluetooth status ● bluetooth.service - Bluetooth service Mar 09 15:16:42 Dell-3470 bluetoothd[1141]: Starting SDP server Mar 09 15:16:42 Dell-3470 bluetoothd[1141]: Bluetooth management interface 1.14> Mar 09 16:35:14 Dell-3470 bluetoothd[1141]: Failed to set mode: Failed (0x03) Mar 09 16:35:59 Dell-3470 bluetoothd[1141]: Failed to set mode: Failed (0x03) Mar 09 16:36:01 Dell-3470 bluetoothd[1141]: Failed to set mode: Failed (0x03) Mar 09 16:36:04 Dell-3470 bluetoothd[1141]: Failed to set mode: Failed (0x03) lines 1-20/20 (END) Mar 9, 2022 at 12:37
  • This answer was correct for me. I wanted to see if it was active and it said so, I think this answers the question. Thanks for the help:)
    – Barra
    May 30, 2022 at 16:24
5

An alternative is to use the command hciconfig. It will list clearly the interfaces, and you will see by the marker "RUNNING" or "DOWN" what is their current status.

5

With BlueZ: Using bluetoothctl (interactive bluetooth control tool), which gives you a terminal with show and these other commands:

[bluetooth]# help
Menu main:
Available commands:
-------------------
advertise                        Advertise Options Submenu
scan                             Scan Options Submenu
gatt                             Generic Attribute Submenu
list                             List available controllers
show [ctrl]                      Controller information
select <ctrl>                    Select default controller
devices                          List available devices
paired-devices                   List paired devices
system-alias <name>              Set controller alias
reset-alias                      Reset controller alias
power <on/off>                   Set controller power
pairable <on/off>                Set controller pairable mode
discoverable <on/off>            Set controller discoverable mode
discoverable-timeout [value]     Set discoverable timeout
agent <on/off/capability>        Enable/disable agent with given capability
default-agent                    Set agent as the default one
advertise <on/off/type>          Enable/disable advertising with given type
set-alias <alias>                Set device alias
scan <on/off>                    Scan for devices
info [dev]                       Device information
pair [dev]                       Pair with device
trust [dev]                      Trust device
untrust [dev]                    Untrust device
block [dev]                      Block device
unblock [dev]                    Unblock device
remove <dev>                     Remove device
connect <dev>                    Connect device
disconnect [dev]                 Disconnect device
menu <name>                      Select submenu
version                          Display version
quit                             Quit program
exit                             Quit program
help                             Display help about this program
export                           Print environment variables

With bluez-tools: bt-* (apropos bt-) like bt-device, a bluetooth device manager.

1
  • Thanks! This also works with Fedora 37! Dec 22, 2022 at 14:50
5

rfkill will show you a list of network devices and if they are on or off.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .