Master the Linux ‘lsusb’ Command: A Comprehensive Guide

Peter Hou
3 min readJun 11, 2023

--

This guide offers Linux newcomers a thorough understanding of this vital utility, equipping them with the knowledge needed to debug USB-related issues, explore the attributes of USB devices, and manage USB peripherals effectively in their Linux system. From identifying a device to exploring a detailed tree view of all connected devices, 'lsusb' proves its worth as an essential part of the Linux user's toolbox.

Instructions

This article is a comprehensive guide to the Linux 'lsusb' command. It covers the command's history, reasons for its creation, and its best use cases. It also provides a detailed usage guide, as well as a thorough discussion of the command's various options and their implications. Additionally, it offers a look at some of the command's most common use cases, tips and tricks, and potential issues.

History

The 'lsusb' command, which stands for "list USB", is part of the usbutils package. It was developed to assist in displaying detailed information about the USB buses in the system and the devices connected to them.

When and why to use it

The 'lsusb' command is mainly used to list all the USB devices connected to a Linux system. This can be extremely useful when debugging hardware issues related to USB devices, or when you simply want to ensure that a particular device has been detected by the system.

How to use it

Running 'lsusb' with no options will display a brief summary of all USB devices currently connected to your system.

$ lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The commonly used parameters

  • -v This option, which stands for "verbose", provides a detailed listing of each USB device.
$ lsusb -v
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.00
...
  • -s This option allows you to specify the bus and device number to provide information about a particular device.
$ lsusb -s 002:002
Bus 002 Device 002: ID 8087:8000 Intel Corp.

Other supported parameters

  • -t Show a topological tree view of the USB devices.
  • -D Specify a device with a sysfs path rather than a bus and device number.
  • -d Specify vendor and product ID to filter the list.

Most common use cases

One of the most common use cases for 'lsusb' is to confirm whether a newly connected USB device has been recognized by the system.

$ lsusb
Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

In this example, a Logitech Unifying Receiver has been successfully detected and recognized by the system.

The tricky skills

You can also use 'lsusb' to list only USB hubs using the -d option with the hub's ID.

$ lsusb -d 1d6b:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

What needs to be noted

Keep in mind that 'lsusb' will only show USB devices. For other types of devices, you will need to use different tools.

Conclusion

The 'lsusb' command is a powerful tool for managing and exploring USB devices on a Linux system. By understanding and utilizing the available options and output formats, it plays a pivotal role in maintaining and troubleshooting a Linux environment.

--

--

Peter Hou

I am a Senior Software Engineer and tech lead in a top tech company.