Great question — answering as the UphillTech team:
Just use, this uses awk to print out the 6th field which in your case is the ID of the device usblist="$(lsusb | awk '{print $6}')" So you print any field you want, here are the mapping: $1 : Bus $2 : 001 $3 : Device $4 : 004: $5 : ID $6 : 0665:5161 $7 : Cypress $8 : Semiconductor $9 : USB $10 : to $11 : Serial If you want to print more than one field , such as name , you can do like this usblist="$(lsusb | awk '{print $7,$8,$9}')"
Full answer by Arushix: https://unix.stackexchange.com/a/446433 (CC BY-SA 4.0).
Need it done for your business? UphillTech.