Advanced USB discovery with usb-devices

usb-devices example

If you’re working with USB devices a lot, Linux platform offers a great way to learn more about what you have connected to your system: usb-devices command.

Using usb-devices Command

Simply type usb-devices and enjoy the output. Below is an example from one of my virtual machines:

greys@mint:~ $ usb-devices
T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh=15
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=04.15
S:  Manufacturer=Linux 4.15.0-54-generic ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1d.7
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  6 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=203a ProdID=fffa Rev=01.00
S:  Manufacturer=Parallels
S:  Product=Virtual Printer (Print to PDF (Mac Desktop))
S:  SerialNumber=TAG11d87aca0
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=01 Driver=usblp

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  9 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=203a ProdID=fffa Rev=01.00
S:  Manufacturer=Parallels
S:  Product=Virtual Printer (Brother HL-L5200DW series)
S:  SerialNumber=TAG1c8860e8b
C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=01 Driver=usblp

Understanding usb-devices Output

There’s a lot of information there, but almost every line is useful.

First line confirms USB port location – system bus and port on it. It’s also a great way of seeing the speed of the port – 480Mbit suggests it’s a USB2 port:

T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  9 Spd=480 MxCh= 0

There’s a few lines documenting the device manufacturer and model name. Because it’s a virtual machine running on my Parallels Desktop software, manufacturer is reported as Parallels. But next line clarifies that this is actually the Brother laser printer from my home office network:

S:  Manufacturer=Parallels
S:  Product=Virtual Printer (Brother HL-L5200DW series)

There’s a line that I imagine will be more useful on laptops, reporting the power consumption reported for this USB port:

C:  #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=0mA

And last, but not least, is the line confirming device driver responsible for functionality of the USB device – should be very handy for troubleshooting:

I: If#= 0 Alt= 0 #EPs= 1 Cls=07(print) Sub=01 Prot=01 Driver=usblp

I’ll run this usb-devices command on my Dell XPS laptop with Ubuntu 19.10 soon and will share my findings.

See Also