ecco un piccolo script bash per determinare il path dev di una periferica usb (ad es: /dev/ttyUSB0)
#!/bin/bash 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
ecco un esempio di output
/dev/video0 - SuYin_HD_Video_WebCam_CN1014-S36D-OV05R-VA-R03.01.01 /dev/input/event7 - SuYin_HD_Video_WebCam_CN1014-S36D-OV05R-VA-R03.01.01 /dev/input/mouse0 - Logitech_USB_Optical_Mouse /dev/input/event5 - Logitech_USB_Optical_Mouse