В Linux команда lsusb
позволяет получить информацию о шинах USB в системе и подключённых к ним устройствах.

Утилита обычно используется для вывода списка всех USB-устройств, подключённых к системе.
Содержание
Синтаксис
oleg@mobile:~:$ lsusb [параметры]...
Параметры
-v, --verbose
Увеличить многословность (показать дескрипторы)
-s [[bus]:][devnum]
Показать только устройства с определёнными номерами устройств и/или шин (в десятичном формате)
-d vendor:[product]
Показать только устройства определённого поставщика и идентификаторы продукта (в шестнадцатеричном формате)
-D device
Выбрать устройство, которое будет проверяться lsusb
-t, --tree
Дамп физической иерархии USB-устройств в виде дерева
-V, --version
Показать версию утилиты
-h, --help
Показать использование и помощь
Использование команды Linux lsusb
Утилита предоставляет подробную информацию об оборудовании USB, подключённого к системе, включая следующие:
- скорость;
- номер шины;
- класс устройства;
- тип устройства.
Базовый пример
При запуске утилиты по умолчанию, то есть без каких-либо параметров будут перечислены все USB-устройства, подключенные к системе, показана основная информация (ID устройств, краткое описание):
oleg@mobile:~:$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 145f:02c9 Trust Trust Keyboard
Bus 001 Device 004: ID 093a:2533 Pixart Imaging, Inc. Gaming Mouse
Bus 001 Device 005: ID 8086:0189 Intel Corp. Centrino Advanced-N 6230 Bluetooth adapter
Bus 001 Device 007: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 003: ID 2232:1020 Silicon Motion WebCam SC-0311139N
oleg@mobile:~:$
Многословный режим
При добавлении к запускаемой команде параметра -v
будет отображена подробная информация о подключённых устройствах:
oleg@mobile:~:$ lsusb -v
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Couldn't open device, some information will be missing
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 [unknown]
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 6.12
iManufacturer 3 Linux 6.12.7-arch1-1 ehci_hcd
iProduct 2 EHCI Host Controller
iSerial 1 0000:00:1d.0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0019
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Couldn't open device, some information will be missing
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 [unknown]
bDeviceProtocol 1 Single TT
bMaxPacketSize0 64
idVendor 0x8087 Intel Corp.
idProduct 0x0024 Integrated Rate Matching Hub
bcdDevice 0.00
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0019
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 12
...
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1400 3x 1024 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 2
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1340 3x 832 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 3
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1300 3x 768 bytes
bInterval 1
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 4
bNumEndpoints 1
bInterfaceClass 14 Video
bInterfaceSubClass 2 Video Streaming
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 5
Transfer Type Isochronous
Synch Type Asynchronous
Usage Type Data
wMaxPacketSize 0x1400 3x 1024 bytes
bInterval 1
oleg@mobile:~:$
Единственное устройство
Для отображения единственного устройства, заданного шиной и/или номером этого устройства, утилита запускается с параметром -s
, за которым должен следовать номер:
oleg@mobile:~:$ lsusb -s 003
Bus 001 Device 003: ID 145f:02c9 Trust Trust Keyboard
Bus 002 Device 003: ID 2232:1020 Silicon Motion WebCam SC-0311139N
oleg@mobile:~:$
Дерево USB
Для отображения физической иерархии USB-устройств в виде дерева команда запускается с параметром -t
:
oleg@mobile:~:$ lsusb -t
/: Bus 001.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/6p, 480M
|__ Port 001: Dev 003, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 001: Dev 003, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M
|__ Port 002: Dev 004, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 002: Dev 004, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 003: Dev 005, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 003: Dev 005, If 1, Class=Wireless, Driver=btusb, 12M
|__ Port 005: Dev 007, If 0, Class=[unknown], Driver=rtl8187, 480M
/: Bus 002.Port 001: Dev 001, Class=root_hub, Driver=ehci-pci/2p, 480M
|__ Port 001: Dev 002, If 0, Class=Hub, Driver=hub/6p, 480M
|__ Port 004: Dev 003, If 0, Class=Video, Driver=uvcvideo, 480M
|__ Port 004: Dev 003, If 1, Class=Video, Driver=uvcvideo, 480M
oleg@mobile:~:$
Конкретное устройство
При запуске утилиты с параметром -D
с добавлением конкретного устройства (Bus 001 Device 007: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter), данные которого отображены в базовом примере, выводится информация об этом устройстве:
oleg@mobile:~:$ lsusb -D /dev/bus/usb/001/007bus/usb/001/007
Device: ID 0bda:8187 Realtek Semiconductor Corp. RTL8187 Wireless Adapter
Couldn't open device, some information will be missing
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 [unknown]
bDeviceSubClass 0 [unknown]
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0bda Realtek Semiconductor Corp.
idProduct 0x8187 RTL8187 Wireless Adapter
bcdDevice 1.00
iManufacturer 1 Manufacturer_Realtek_RTL8187_
iProduct 2 RTL8187_Wireless
iSerial 3 00C0CA703801
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0027
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 0 [unknown]
bInterfaceSubClass 0 [unknown]
bInterfaceProtocol 0
iInterface 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
oleg@mobile:~:$
Заключение
Описанная в этой небольшой статье команда Linux lsubg
особенно ценна для устранения неполадок USB-устройств и понимания аппаратной конфигурации конкретного дистрибутива операционной системы Linux.