udevadm
Learn how to use udevadm to inspect device properties, explore sysfs paths, monitor udev events, test udev rules, and debug hardware on Linux systems.
If you want properties (ENV style) rather than the attribute-walk
To find the underlying parent device (USB device path), do
Setting headphones to on/off and following will show up
udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[114270.712195] remove /devices/virtual/input/input36/event20 (input)
UDEV [114270.723087] remove /devices/virtual/input/input36/event20 (input)
KERNEL[114270.750362] remove /devices/virtual/input/input36 (input)
UDEV [114270.750918] remove /devices/virtual/input/input36 (input)
KERNEL[114271.022271] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.3/1-3.3:1.0/bluetooth/hci0/hci0:69 (bluetooth)
UDEV [114271.024572] remove /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.3/1-3.3:1.0/bluetooth/hci0/hci0:69 (bluetooth)
KERNEL[114276.446328] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.3/1-3.3:1.0/bluetooth/hci0/hci0:71 (bluetooth)
UDEV [114276.454486] add /devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.3/1-3.3:1.0/bluetooth/hci0/hci0:71 (bluetooth)
KERNEL[114277.949132] add /devices/virtual/input/input37 (input)
KERNEL[114277.949530] add /devices/virtual/input/input37/event20 (input)
UDEV [114277.951557] add /devices/virtual/input/input37 (input)
UDEV [114277.988819] add /devices/virtual/input/input37/event20 (input)
Identify the PCI controller backing /dev/sda
See if a drive is luks protected by udevadm
Extract the group names referenced in udev rules and the group names actually present on the system
Dump serial number for disk drive of sdc