lsusb

2024-08-17

Understanding the lsusb Command

The lsusb command is a simple yet effective tool for identifying USB devices. It queries the USB subsystem and lists each connected device, providing information like vendor ID, product ID, device description, and more. This information is essential for troubleshooting connectivity issues, identifying unknown devices, and ensuring compatibility.

The basic syntax is straightforward:

lsusb

Running this command will produce a list similar to this (your output will vary depending on your connected devices):

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 046d:c077 Logitech, Inc. Wireless Mouse
Bus 001 Device 002: ID 8087:07da Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Each line represents a single USB device. Let’s break down the components:

Advanced Usage of lsusb

lsusb offers many options to refine your output and target specific information:

1. Filtering by Vendor ID:

You can filter the output to show only devices from a specific vendor using the -d option. For example, to list only Logitech devices (assuming their vendor ID is 046d):

lsusb -d 046d:

2. Filtering by Vendor and Product ID:

For more precise filtering, specify both Vendor ID and Product ID:

lsusb -d 046d:c077

This would only list Logitech wireless mice with the product ID c077.

3. Verbose Output:

The -v option provides a much more detailed description of each device, including configuration details, interfaces, and more. This is extremely useful for troubleshooting:

lsusb -v -d 046d:c077

4. Specific Device Information:

You can even target a specific device using its bus and device numbers:

lsusb -v -d 001:003

This would provide verbose information about the device on bus 001, device 003.

Practical Applications

lsusb proves useful in various scenarios:

These examples provide a solid foundation for utilizing the lsusb command. Experiment with different options and filters to fully use its potential in managing your USB devices within the Linux environment.