Using lsusb in Linux to Identify Connected USB Devices and Their Specifications
Introduction
The lsusb command in Linux is a powerful tool for listing USB devices connected to your system. It provides detailed information about each USB device, including the vendor ID, product ID, and device class. This article will guide you through using lsusb to see what devices you have connected and how to determine the types of USB connectors, hubs, and speeds your computer supports.
Basic Usage of lsusb
To list all USB devices connected to your system, open a terminal and type the following command:
This will display a list of all USB devices connected to your system. The output will look something like this:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0
Each line in the output represents a USB device connected to your system. The first column shows the bus number and device number of the device. The second column shows the vendor ID and product ID of the device. The third column shows the device class and protocol.
Detailed Information with lsusb -v
To get more detailed information about a specific USB device, you can use the -v (verbose) option with the lsusb command:
This will display detailed information about each USB device, including configuration descriptors, interface descriptors, and endpoint descriptors. The output will be quite lengthy, so you may want to redirect it to a file for easier reading:
Identifying USB Connectors, Hubs, and Speeds
To see what kind of USB connectors, hubs, and speeds your computer supports, you can look at the detailed output from the lsusb -v command. Here are some key points to look for:
- Bus Number: Indicates the physical USB bus number to which the device is connected.
- Device Speed: Indicates the speed at which the device is connected (e.g., low speed, full speed, high speed, super speed).
Example output for different speed hubs and devices:
High-Speed USB 2.0 Device
Bus 001 Device 002: ID 8087:0024 Intel Corp.
Integrated Rate Matching Hub Device Descriptor: bcd
USB 2.00
bDeviceClass 9
Hub b DeviceProtocol 1
Single TT b
MaxPacketSize0 64
idVendor 0x8087 Intel Corp.
idProduct 0x0024 Integrated Rate Matching Hub bcd
Device 0.00
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor: bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
MaxPower 100mA
Interface Descriptor: bLength 9
bDescriptorType 4
bInterfaceNumber 0 bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9
Hub bInterfaceSubClass 0
bInterfaceProtocol 0
Full speed (or root) hub iInterface 0
Endpoint Descriptor: bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
wMaxPacketSize 0x0002 1x 2 bytes bInterval 12 [/
SuperSpeed USB 3.0 Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Device
Descriptor: bcd
USB 3.00
bDeviceClass 9 Hub
bDeviceProtocol 3
Single TT
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0003 3.0 root hub
bcdDevice 3.00
iManufacturer 3 Linux 5.4.0-42-generic xhci-hcd
iProduct 2 xHCI Host Controller
iSerial 1 0000:00:14.0
bNumConfigurations 1
Configuration Descriptor:
bLength 9 bDescriptorType 2
wTotalLength 31
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0 MaxPower 0mA
Interface Descriptor: bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7 b
DescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3 wMaxPacketSize 0x0002 1x 2 bytes
bInterval 12
Conclusion
Using the lsusb command in Linux, you can easily list all USB devices connected to your system and get detailed information about each device, including the types of USB connectors, hubs, and speeds your computer supports. This can be particularly useful for troubleshooting and ensuring that your devices are connected and functioning correctly.