← 返回命令列表

Linux command

bluetooth 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Start Bluetooth interactive mode

bluetoothctl

Power on the Bluetooth adapter

bluetoothctl power on

Scan for devices

bluetoothctl scan on

List discovered devices

bluetoothctl devices

Pair with a device

bluetoothctl pair [MAC_address]

Connect to a paired device

bluetoothctl connect [MAC_address]

Trust a device

bluetoothctl trust [MAC_address]

Disconnect a device

bluetoothctl disconnect [MAC_address]

Remove a paired device

bluetoothctl remove [MAC_address]

说明

bluetoothctl is the command-line interface for managing Bluetooth devices on Linux systems using BlueZ, the official Linux Bluetooth protocol stack. It provides complete control over Bluetooth adapters, device discovery, pairing, and connections. In interactive mode (run without arguments), bluetoothctl provides a shell with tab completion for exploring commands and devices. Commands can also be executed directly from the shell for scripting. The tool manages the full device lifecycle: scanning discovers nearby devices, pairing establishes a secure relationship, trusting enables automatic reconnection, and connecting activates the device for use. Multiple adapters are supported via the select command.

参数

power _on_|_off_
Turn Bluetooth adapter on or off.
scan _on_|_off_
Start or stop device discovery.
devices
List discovered devices.
paired-devices
List devices that are paired.
pair _MAC_
Initiate pairing with device.
trust _MAC_
Mark device as trusted (auto-connect).
untrust _MAC_
Remove trusted status from device.
connect _MAC_
Connect to a paired device.
disconnect _MAC_
Disconnect from device.
remove _MAC_
Remove device from known devices.
info _MAC_
Show detailed device information.
block / unblock _MAC_
Block or unblock a device.
discoverable _on_|_off_
Make adapter visible to other devices.
agent _capability_
Set agent for pairing (NoInputNoOutput, DisplayOnly, etc.).

FAQ

What is the bluetooth command used for?

bluetoothctl is the command-line interface for managing Bluetooth devices on Linux systems using BlueZ, the official Linux Bluetooth protocol stack. It provides complete control over Bluetooth adapters, device discovery, pairing, and connections. In interactive mode (run without arguments), bluetoothctl provides a shell with tab completion for exploring commands and devices. Commands can also be executed directly from the shell for scripting. The tool manages the full device lifecycle: scanning discovers nearby devices, pairing establishes a secure relationship, trusting enables automatic reconnection, and connecting activates the device for use. Multiple adapters are supported via the select command.

How do I run a basic bluetooth example?

Run `bluetoothctl` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does power _on_|_off_ do in bluetooth?

Turn Bluetooth adapter on or off.