← 返回命令列表

Linux command

cec-client 命令

文本

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

常用示例

List

cec-client -l

Example

sudo cec-client

Example

sudo cec-client -o [name]

Send a single command

echo [on 0] | sudo cec-client -s

Example

standby [0]

Turn on

on [0]

说明

cec-client manages CEC (Consumer Electronics Control) connections over HDMI using the libCEC library. CEC is a feature of the HDMI specification that allows devices connected via HDMI to control each other, enabling actions like turning on a TV when a media player starts, or controlling volume across devices with a single remote. The tool provides both interactive and scripted control of CEC-enabled devices. In interactive mode, you can send commands like `on`, `standby`, and `tx` (raw CEC frames) to any device on the HDMI bus. For automation, the `-s` flag processes a single command from stdin and exits, making it suitable for use in scripts and home automation setups. Devices are addressed by logical address (0-15), where 0 is typically the TV, 1 is a recording device, and 5 is an audio system.

参数

-l, --list-devices
List available CEC adapters
-o, --osd-name _name_
Set the On-Screen Display name
-s, --single-command
Execute a single command from stdin and exit
-d _device_
Use specific CEC device

FAQ

What is the cec-client command used for?

cec-client manages CEC (Consumer Electronics Control) connections over HDMI using the libCEC library. CEC is a feature of the HDMI specification that allows devices connected via HDMI to control each other, enabling actions like turning on a TV when a media player starts, or controlling volume across devices with a single remote. The tool provides both interactive and scripted control of CEC-enabled devices. In interactive mode, you can send commands like `on`, `standby`, and `tx` (raw CEC frames) to any device on the HDMI bus. For automation, the `-s` flag processes a single command from stdin and exits, making it suitable for use in scripts and home automation setups. Devices are addressed by logical address (0-15), where 0 is typically the TV, 1 is a recording device, and 5 is an audio system.

How do I run a basic cec-client example?

Run `cec-client -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list-devices do in cec-client?

List available CEC adapters