udevadm
system administrationLinux
The udevadm command is one of the most frequently used commands in Linux/Unix-like operating systems. udevadm udev management tool for device detection and configuration
Quick Reference
Command Name:
udevadm
Category:
system administration
Platform:
Linux
Basic Usage:
udevadm [options] [arguments]
Common Use Cases
Syntax
udevadm [--help] [--version] [--debug] COMMAND [OPTIONS]
Options
The udevadm
command has several sub-commands, each with their own options:
Main Options
Option | Description |
---|---|
--debug |
Print debug messages to stderr |
--version |
Print version of the program |
--help |
Print help text |
Sub-commands
Command | Description |
---|---|
info |
Query sysfs or the udev database |
trigger |
Request events from the kernel |
settle |
Wait for pending udev events |
control |
Control the udev daemon |
monitor |
Listen to kernel and udev events |
test |
Test an event run |
test-builtin |
Test a built-in command |
Common Options for 'info' Sub-command
Option | Description |
---|---|
--query=TYPE |
Query mode (name, path, property, all) |
--name=DEVNAME |
Name of device to query |
--path=DEVPATH |
Path of device to query |
--attribute-walk |
Print all sysfs properties |
Common Options for 'monitor' Sub-command
Option | Description |
---|---|
--kernel |
Print kernel events |
--udev |
Print udev events |
--property |
Print device properties |
--subsystem-match=SUBSYSTEM |
Filter by subsystem |
Common Options for 'trigger' Sub-command
Option | Description |
---|---|
--action=ACTION |
Event action (add, change, remove) |
--subsystem-match=SUBSYSTEM |
Trigger devices from a subsystem |
--attr-match=ATTRIBUTE=VALUE |
Trigger devices with a specific attribute |
--verbose |
Print the list of devices that will be triggered |
Common Options for 'control' Sub-command
Option | Description |
---|---|
--reload-rules |
Reload rules files |
--start-exec-queue |
Start execution of events |
--log-priority=LEVEL |
Set log level (err, info, debug...) |
--exit |
Signal udevd to exit |
Examples
How to Use These Examples
The examples below show common ways to use the udevadm
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
Get information about a device
sudo udevadm info --name=/dev/sda
Monitor udev events in real-time
sudo udevadm monitor
Reload udev rules without rebooting
sudo udevadm control --reload-rules
Trigger udev events for all devices
sudo udevadm trigger
Advanced Examples:
Get all udev properties for a specific device
sudo udevadm info --attribute-walk --name=/dev/sda
Monitor only device events (not udev events)
sudo udevadm monitor --kernel