How to query USB device information using udev
You can use udevadm to query information such as the USB device path for a given USB device such as /dev/usbtmc0
:
udevadm info -q all /dev/usbtmc0
Example output:
P: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/usbmisc/usbtmc0
N: usbtmc0
L: 0
E: DEVPATH=/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/usbmisc/usbtmc0
E: DEVNAME=/dev/usbtmc0
E: MAJOR=180
E: MINOR=176
E: SUBSYSTEM=usbmisc