How to Use the lsusb Command in Linux?

The “lsusb” command is a command-line utility that can be utilized to visualize the details about the USB devices connected to a system. It is useful for troubleshooting USB device issues or getting information about the USB devices connected to a system.

This guide aims to demonstrate the “lsusb” command in Linux. The content of the post is:

How Does lsusb Command Work in Linux?

The “lsusb” command is a part of the “usbutils” package, a collection of Linux utilities showing data regarding USB buses in the operating system and connected devices. It can also display detailed information about a specific USB device, such as its manufacturer, product name, and serial number.

Syntax:

The general syntax of the “lsusb” command is provided below:

$ lsusb [options]

In the above syntax, the “lsusb” command shows the details of connected devices and USB buses in the system.

To explore more options of the “lsusb” command, the “help” utility can be utilized as below:

$ lsusb --help

Let’s see the practical implementation of the “lsusb” command.

Example 1: List All USB Devices

To visualize all USB-connected devices to the system, you can simply run the “lsusb” script without any arguments as below:

$ lsusb

The output shows connected USB devices along the device’s vendor ID, product ID, and device class.

Example 2: Display Content About a Specific USB Device

The “lsusb” command shows detailed information regarding a particular USB device. For this, it requires the specified vendor and product ID of the USB device:

$ lsusb -v -d 0e0f:0002

This output visualizes the detailed information about the USB device having vendor ID “0e0f” and product ID “0002“.

Example 3: Display Content About a Specific USB Bus

To display information about a specific USB bus, the “-s” option is utilized with the bus id. For instance, the command below takes 02 as a bus id:

$ lsusb -s 02

The output displays the information about the USB bus with the specified number.

Example 4: Display Information in Tree Structure

To display the information about a USB device in a format that is easy to parse by other programs, the -t option is utilized as below:

$ lsusb -t

It displays a tree-like view of the USB devices and buses in the system.

Example 5: Display the USB Devices in Readable Format

To display the USB devices in a format that a script can read, use the “-D” option by specifying the device and bus number:

$ lsusb -D /dev/bus/usb/002/003

The output shows the detailed descriptors of the device connected to the specific bus.

Conclusion

Linux offers the “lsusb” command to visualize the connected USB devices to the system. It includes the device’s vendor ID, product ID, and device class. We can also show detailed information about a particular USB device. This article has explained the “lsusb” command with all considerable examples in Linux.