命令
顯示本機的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