for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
(
syspath="${sysdevpath%/dev}"
devname="$(udevadm info -q name -p $syspath)"
[[ "$devname" == "bus/"* ]] && continue
eval "$(udevadm info -q property --export -p $syspath)"
[[ -z "$ID_SERIAL" ]] && continue
echo "/dev/$devname - $ID_SERIAL"
)
done
Running it on my system gives:
~ $ usbdiscover.sh
/dev/input/event9 - Chicony_USB2.0_HD_UVC_WebCam
/dev/video0 - Chicony_USB2.0_HD_UVC_WebCam
/dev/ttyUSB0 - Parallax_Inc_DEF_CON_22_Badge_DAXU3JTE
/dev/input/event1 - Logitech_USB_Receiver
/dev/input/mouse0 - Logitech_USB_Receiver
/dev/input/event9 - Chicony_USB2.0_HD_UVC_WebCam
/dev/video0 - Chicony_USB2.0_HD_UVC_WebCam
/dev/ttyUSB0 - Parallax_Inc_DEF_CON_22_Badge_DAXU3JTE
/dev/input/event1 - Logitech_USB_Receiver
/dev/input/mouse0 - Logitech_USB_Receiver
No comments:
Post a Comment