Linux硬件管理命令--lsusb命令详解
命令
显示本机的usb设备列表,可以显示出usb的详细信息,包括设备的读取速度和描述符。
1、语法
lsusb [选项]
2、选项列表
选项 |
说明 |
-v |
告诉lsusb详细显示所示设备的详细信息。这包括设备当前速度的配置描述符。如果可用,类描述符将显示USB设备类,包括集线器、音频、HID、通信和芯片卡。 |
-s [[bus]:][devnum] |
显示指定总线和设备号的设备信息,总线和设备号用十进制标识。格式:lsusb –s 00:01 |
-d [vendor]:[product] |
显示指定厂商和产品编号的设备,用十六进制表示编号。格式:lsusb –d 8086: |
-D |
显示指定设备文件的设备信息,例如:lsusb –D /proc/bus/usb/001/001。只有 root用户才可以使用这个选项 |
-t |
以树状结构显示 |
-V |
指令版本信息 |
如果指定的设备没有被找到,那么返回一个非0值。/usr/share/hwdata/usb.ids文件中记录了所有的USB设备节点的信息,包括制造商、产品号、类、子类、协议等等。
3、实例
1)直接显示简单的设备信息
[root@localhost ~]# lsusb
//总线号 设备号 厂商ID
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
2)显示详细信息
[root@localhost ~]# lsusb -v
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubDevice Descriptor: //设备描述符
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 4.18
iManufacturer 3 Linux 4.18.0-80.el8.x86_64 ehci_hcd
iProduct 2 EHCI Host Controller
iSerial 1 0000:00:1d.7
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
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
Hub Descriptor: //集线器描述符
bLength 9
bDescriptorType 41
nNbrPorts 6
wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status: //集线器端口状态
Port 1: 0000.0100 power
Port 2: 0000.0100 power
Port 3: 0000.0100 power
Port 4: 0000.0100 power
Port 5: 0000.0100 power
Port 6: 0000.0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001 //设备状态
Self Powered
3)显示指定总线上的设备
[root@localhost ~]# lsusb -s 001:001
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
4)显示指定厂商的设备信息
[root@localhost ~]# lsusb -d 1d6b:0001
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
5)以树状结构显示
[root@localhost ~]# lsusb -t
/: Bus 06.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
/: Bus 05.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, class="root_hub", Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, class="root_hub", Driver=ehci-pci/6p, 480M
/: Bus 01.Port 1: Dev 1, class="root_hub", Driver=ehci-pci/2p, 480M