Linux lsusb Command
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
- View the list of USB devices currently connected to the system
- Obtain detailed information about USB devices (vendor ID, product ID, etc.)
- Diagnose USB connection issues
- 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:
Bus XXX: USB bus numberDevice XXX: Device number on that busID XXXX:XXXX: Vendor ID:Product ID- Device description information
2. Display Detailed Information (the -v Option)
Example
lsusb
-v
This command outputs very detailed USB device information, including:
- Device descriptors
- Configuration descriptors
- Interface descriptors
- Endpoint descriptors
- USB protocol versions supported by the device
- Device class, subclass, and protocol
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:
- Faulty physical connection of the device
- Faulty USB port or hub
- Insufficient power to the device
- Kernel driver issues
Q2: How Do I Determine Device Speed from the lsusb Output?
In the verbose output (lsusb -v), look for bcdUSB field:
2.00: USB 2.03.00: USB 3.03.10: USB 3.1
Q3: How Do I Permanently Save the lsusb Output?
Example
lsusb
usb_devices.txt
Practical Exercise
- Plug in a USB device and observe the
lsusbchanges in the output - Use
-dUse an option to find devices from a specific vendor - Comparison
lsusbandlsusb -vthe difference in output - Try using
-tUse an option to understand the connection topology of USB devices
Summary
lsusb is a simple yet powerful tool that helps users and system administrators:
- Quickly view connected USB devices
- Obtain detailed device information
- Diagnose USB-related issues
- Provide the information needed for driver installation
Mastering the lsusb Using the command lets you manage and debug USB devices more efficiently in a Linux environment.
Linux Command Reference