请关注本头条号,每天坚持更新原创干货技术文章。
如需学习视频,请在微信搜索公众号“智传网优”直接开始自助视频学习。
了解lsusb命令
Linux使用lsusb查看USB设备信息。
安装工具:
[root@zcwyou ~]# yum -y install usbutils
1. 查看USB设备汇总信息
命令:
[root@zcwyou ~]# lsusb
输出:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 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 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
2.查看USB详细信息
命令
[root@zcwyou ~]# lsusb -v
部分输出结果:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 2.06
iManufacturer 3 Linux 2.6.32-431.el6.x8664 ehcihcd
iProduct 2 EHCI Host Controller
iSerial 1 0000:00:1d.7
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
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 Unused
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 11
bDescriptorType 41
nNbrPorts 8
wHubCharacteristic 0x000a
No power switching (usb 1.0)
Per-port overcurrent protection
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00 0x00
PortPwrCtrlMask 0xff 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
Port 7: 0000.0100 power
Port 8: 0000.0100 power
Device Status: 0x0003
Self Powered
Remote Wakeup Enabled
3. 树状输出信息
命令:
[root@zcwyou ~]# lsusb -t
输出结果:
/: Bus 05.Port 1: Dev 1, Class=roothub, Driver=uhcihcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=roothub, Driver=uhcihcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=roothub, Driver=uhcihcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=roothub, Driver=uhcihcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=roothub, Driver=ehcihcd/8p, 480M
总结:Linux使用lsusb专门查询USB信息。
原文链接:
https://www.linuxrumen.com/cyml/384.html
点击了解更多,快速查看更多的技术文章列表。
路由