Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux lsusb Command

Linux lsusb Command

Linux Command Reference Linux Command Reference


What Is the lsusb Command

lsusb is a utility command in Linux used to list all USB devices connected to the computer. It is short for "list USB" and can display detailed information about the USB buses and the devices connected to them.

Command Functions

  1. View the list of USB devices currently connected to the system
  2. Obtain detailed information about USB devices (vendor ID, product ID, etc.)
  3. Diagnose USB connection issues
  4. Verify whether USB devices are correctly recognized by the system

Basic Syntax



lsusb [选项]

Description of common options and parameters

Option Description
-v Display detailed output (verbose), including device descriptor information
-t Display the USB device hierarchy in a tree structure
-s [[bus]:][devnum] Display only devices with the specified bus and device numbers
-d [vendor]:[product] Display only devices with the specified vendor ID and product ID
-D 设备文件 Display detailed information for a specified device file
--help Display help information
--version Display version information

Basic Usage Example

1. List All USB Devices (Basic Usage)

Example

lsusb

Typical output example:

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 004: ID 8087:0a2b Intel Corp. 

Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Output analysis:

2. Display Detailed Information (the -v Option)

Example

lsusb

-v

This command outputs very detailed USB device information, including:


Advanced usage

1. Display USB Device Connections in a Tree

Example

lsusb

-t

Example output:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M

/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 480M

    |__ Port 3: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M

    |__ Port 4: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M

2. Filter Specific Devices

Example

Display only devices on bus 1

lsusb

-s

1

:

Display only device 3 on bus 1

lsusb

-s

1

:

3

Display only Logitech devices (by vendor ID:product ID)

lsusb

-d

046d:

3. View Information for a Specific Device File

Example

lsusb

-D

/

dev

/

bus

/

usb

/

001

/

003


Practical Application Scenarios

1. Check Whether a USB Device Is Recognized

When a USB device is plugged in but does not work, first use lsusb to check whether the system has recognized the device.

2. Obtain Device IDs for Driver Installation

Many Linux drivers need to know a device's vendor ID and product ID; this information can be obtained through lsusb .

3. Debug USB Connection Issues

By comparing the output before and after plugging in the device, lsusb you can determine whether the device is correctly recognized.

4. View Detailed USB Device Information

Use -v The option retrieves detailed technical specifications of a device, which helps when developing USB-related applications.


Frequently Asked Questions

Q1: Why Doesn't My USB Device Appear in the lsusb Output?

Possible reasons:

  1. Faulty physical connection of the device
  2. Faulty USB port or hub
  3. Insufficient power to the device
  4. Kernel driver issues

Q2: How Do I Determine Device Speed from the lsusb Output?

In the verbose output (lsusb -v), look for bcdUSB field:

Q3: How Do I Permanently Save the lsusb Output?

Example

lsusb

usb_devices.txt


Practical Exercise

  1. Plug in a USB device and observe the lsusb changes in the output
  2. Use -d Use an option to find devices from a specific vendor
  3. Comparison lsusb and lsusb -v the difference in output
  4. Try using -t Use an option to understand the connection topology of USB devices

Summary

lsusb is a simple yet powerful tool that helps users and system administrators:

Mastering the lsusb Using the command lets you manage and debug USB devices more efficiently in a Linux environment.

Linux Command Reference Linux Command Reference