Common Match Keys

The following table describes commonly used match keys in rules.

Match Key Description

ACTION

Matches the name of the action that led to an event. For example, ACTION="add" or ACTION="remove".

ENV{key}

Matches a value for the device property key. For example, ENV{DEVTYPE}=="disk".

KERNEL

Matches the name of the device that is affected by an event. For example, KERNEL=="dm-*" for disk media.

NAME

Matches the name of a device file or network interface. For example, NAME="?*" for any name that consists of one or more characters.

SUBSYSTEM

Matches the subsystem of the device that is affected by an event. For example, SUBSYSTEM=="tty".

TEST

Tests wheter the specified file or path exists; for example, TEST=="/lib/udev/devices/$name", where $name is the name of the matched device file.

Other match keys include ATTR{filename}, ATTRS{filename}, DEVPATH, DRIVER, DRIVERS, KERNELS, PROGRAM, RESULT, SUBSYSTEMS, and SYMLINK.