Sunday, June 2, 2013

Find USB device details in Linux/Unix using lsusb command

Today we will see how to list USB devices in Linux and their properties
such as speed, BUS, class, type details etc. This is part of our on
going hardware detection series. We already covered following stuff.

What is USB?

USB(Universal Serial Bus)
is a standerd developed to replace different types of BUS's available.
This is a solution deviced to elemenate vender lockdown of hardware
ports, so that BUS's will be identical across different devices from
different venders. USB devices solve one more problem i.e. speeds. USB
devies can reach up 5GB/s as of this writing where as PCI and
serial devices have less speeds. Depending of USB frimware, its
catagarize in to USB 1.0, USB 2.0, USB 3.0. USB have compititor in the
from of Thunderbolt interface.
As a Linux User/administrator we should know USB bus details as well as devices connected. In this post we will see how to use lsusb command to display different USB properties.

Let us try to understand above output in detail.Bus 002Device 003: ID 0781:5567SanDisk Corp.Cruzer BladeBus 002 : This is bus number where SanDisk USB stick is attached.Device 003: This
is the third device attached to bus 002, the other two devices are
"Linux Foundation 2.0 root hub" and " Intel Corp. Integrated Rate
Matching Hub"ID 0781:5567
is the number given to this SanDisk, The nember before : indicates the
manufacture ID and number after : indicates device ID. To get more info
on this visit Linux-USB site.SanDisk Corp. Cruzer Blade is the name of manafacutre and device name.Example 2: Check how many USB ports available in your machine so that we can connect USB devices to these ports.

These ports may be internal or external to the system.Example3 : Get detailed information of a USB device
connected to a machine. Suppose I want to see information about
/dev/bus/usb/002/005 device use below command