← 返回命令列表

Linux command

hwdb 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Update hardware database

sudo systemd-hwdb update

Query device properties

systemd-hwdb query [modalias]

Show hardware database path

systemd-hwdb --help

说明

hwdb (Hardware Database) is a systemd component that maps hardware properties to udev device attributes. It matches hardware by modalias strings and sets properties like device names, permissions, and driver hints. The database is compiled from text files in /usr/lib/udev/hwdb.d/ and /etc/udev/hwdb.d/ into a binary format for fast matching.

参数

update
Compile hwdb files to binary.
query _modalias_
Query properties for modalias.
--path _path_
Custom hwdb path.
--root _root_
Root directory.
--strict
Strict parsing mode.
--usr
Use /usr directory.

FAQ

What is the hwdb command used for?

hwdb (Hardware Database) is a systemd component that maps hardware properties to udev device attributes. It matches hardware by modalias strings and sets properties like device names, permissions, and driver hints. The database is compiled from text files in /usr/lib/udev/hwdb.d/ and /etc/udev/hwdb.d/ into a binary format for fast matching.

How do I run a basic hwdb example?

Run `sudo systemd-hwdb update` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does update do in hwdb?

Compile hwdb files to binary.