I want to know how I can list all udev rules.
I know that in they can be potentially stored as lines (one line = one rule) in *.rules
files in these directories
/etc/udev/rules.d
/lib/udev/rules.d
/run/udev/rules.d
/var/run/udev/rules.d
Therefore I though I can find all rules by simple concating all the *.rules
files in those directories. This seems not to be working (because some rules are executed which I cannot find anyware as rules in these directories).
At best I thought that there is a command to the udevadm interface which will let me print out all the rules that udev currently has.
To be certain I did a review of man udevadm
and especially the part about udevadm info [parameters]
does not seem to yield any result.
Given that udev allows for a multitude of files and rules all targeted for the very same device, it is frustrating not to know an efficient/feasible way to compose all the rules for a device.
Best Answer
If you use:
you get an entry for each action taken by KERNEL and UDEV. Typically add, change, remove. If you include the
--property
option:You will get a listing of what properties are used.
As one can test udev rules with udevadm:
one could test out something as this:
but not sure how reliable this is. Anyhow, using e.g.
video1
for<device>
that could yield something like:But guess looking at the test as a whole is better. Also note the message:
You can also set
in
udev.conf
and restart udev (reload udev
) to get a somewhat more verbose output.