How to Use Lsusb in Linux (With a Practical Example)
Quick Linkswhat Is Lsusb? Using Lsusb: First Run Lsusb: Diving Deeper Wrapping up Learn How to Use the Lsusb Tool in Linux with a Practical Example. the Lsusb...
Learn how to use the lsusb tool in Linux with a practical example. The lsusb will list all USB devices in a system and USB hubs and provide detailed information on each of them.
What Is lsusb?
lsusb is a command-line tool in Linux, installed by default as part of your (modern) Linux Operating System, which can list and enumerate all USB devices, including USB hubs found within the system on which it is being executed. It will work on desktops, servers, and other common Linux-running hardware like Raspberry Pi's, etc.
As the tool is installed by default, there is no need to install it, and it cannot be uninstalled. The only way to remove it completely from a system would be to use sudo to remove (
rm
) the actual binary (commonly at
/usr/bin/lsusb
) and the manual (commonly at
/usr/share/man/man8/lsusb.8.gz
).
You can access the complete but small lsusb manual by issuing
man lsusb
at a Terminal command prompt.
To access the command prompt, if you are using a desktop GUI, you will often have to click your operating system's action button (like the green button commonly at the bottom left in Linux Mint or the Activities button at the top left in Ubuntu) and type Terminal and click the corresponding option, or you may like to try the Windows key on your keyboard in combination with the letter
T
(hold the Windows key, then press
T
).
Must Read
Using lsusb: First Run
When you first run lsusb from a Terminal command prompt, you will get a brief/concise list of output, showing various items of information about the USB devices in your system:
lsusb
Here we first see the USB Bus (a computer/system bus is a transport mechanism the customer uses, just like a bus in real life, to transport data from one item to another, for example, from a USB device - like a mouse or keyboard - to the processor) number, followed by a device number, a USB Device ID and finally a textual description of the device.
Note that the USB Device ID has two parts. The first part (before the :) is a USB devices vendor identifier, associated with a specific vendor, and the second part is a subsystem USB device number. So, for example, the Holtek Semiconductor device with USB device ID 04d9:1203 has 04d9 which is associated with Holtek Semiconductor, Inc. and the subsystem device (the actual USB device or USB software emulator by that vendor) is a keyboard.
Of interest here is that such Device IDs can be entered into your favorite search engine. Preferably this should be done with double quotes around the full ID or without quotes if you are only searching the first or second part, in which case you may want to add USB as a generic keyword. In both cases, this would produce reliable search results.
Having the ability to search such Device IDs online also opens up the possibility to find that driver for that odd USB device from years ago by using a Device ID. You can add a keyword like "driver", "download" and/or similar to obtain more accurate search results.
Note that it may also be possible to search for a similar driver by the same hardware vendor if you cannot find the actual target driver, as sometimes drivers include support for a whole array of devices by the manufacturer. Finally, the last textual output column of the lsusb output may provide a good hint as to what the device is.
Also, note that devices listed in lsusb are not necessarily always hardware/physical devices. They may be software hub interfaces that take care of, for example, relaying hardware signals from an actual physical USB device to the operating system. For example, let's run lsusb inside VirtualBox (a software package that emulates computer hardware and allows running other operating systems from within a host operating system):
Note that VirtualBox will use (or rather; emulate) the most common/default USB standard, i.e. Linux Foundation 1.1 root hub whereas a modern system will also list Linux Foundation 2.0 root hub and Linux Foundation 3.0 root hub hubs - i.e. USB 1.1 versus USB 2.0 and USB 3.0. This is handy if you quickly want to see if a system is modern or not; lsusb will show if there is a USB 3.0 hub in the system (if the hardware is not virtualized), a good indicator that the system at least has some level of modernity!