I am able to get this information for a fixed USB device using Udev:
Now I have to get the full string which is related to the vendor and the product ID. I found out that the file /usr/share/misc/usb.ids contains information that I am looking for:
13 b1linksus 000bWUSB11 v4 .0 802.11b Adapter 000d WUSB54G Wireless Adapter 0011 WUSB54GP v4.0 802.11g Adapter 0018 USBMMDM 10/100 Ethernet Adapter 001 AHU 200 TS Wireless Adapter 001 AUUSBFF 54G 802.11 BG0020 Wusby 54GC 802.11g Adapter [Ralic RT 73] 0023 Wusby 54GR 0024 WBSBF 54G v1.1 802.11 bg However, it is not clear to me B How should I retrieve the data in their data. Is there an API available or should I parse the file? If I choose to parse it, then what is /usr/share/misc/usb.ids always going to be the right place?
lsusb command gives information about currently plugged USB devices You can use your -d option for a specific vendor / product (but it works only for currently plugged devices):
< Code> $ lsusb -d 0e21: 0750 bus 001 device 005: ID 0e21: 0750 Cowon Systems, Inc.
You can show information for all devices:
$ lsusb bus 001 device 001: id 1d6b: 0002 linux foundation 2.0 root hub bus 001 device 004: ID 0421: 01C7 Nokia Mobile Phone Bus 001 Device 003: ID 0 BDA: 8187 RealTech Semiconductor Corp. RL8187 Wireless Adapter Bus 001 Device 005: ID 0e21: 0750 Cowan Systems, Inc. Bus 002 Device 001: ID 1d6b: 0002 Linux Foundation 2.0 Root Hub Bus 003 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 Route Hub Bus 004 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 Root Hub Bus 005 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 Root Hub Bus 006 Device 001: ID 1d6b: 0001 Linux Foundation 1.1 Root Hub Bus 006 Device 002: ID 046D: C-101B Logitech, Inc. MX310 Optical Mouse Bus 007 Device 001: ID1DB: 0001 Linux Foundation 1.1 ro OT Hub Bus 008 Device 001: ID1d6b: 0001 Linux Foundation 1.1 Route Hub Can create verbose ( lsusb -v ) and print lot more of stuff.
Note that when accessing information about the system in Linux OS, these command accesses to directly parse the shell command (such as lsusb ) system command Use the.