是否有任何工具可以在 shell 中以树结构列出 USB 子系统的控制器、集线器和设备?
lsusb
列表平淡,不显示所有详细信息。usbview
有 GUI,但显示树结构和设备的所有详细信息。有没有显示任何内容的工具usbview
,除了在 shell 上?
答案1
-t
显示树输出:
$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/1p, 5000M
|__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/2p, 5000M
这也显示了当前速度,因此您可以看到例如速度为 12 Mbps 的键盘和鼠标。
用于-tv
更详细的输出,包括类描述符(供应商):
$ lsusb -tv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/1p, 5000M
ID 2109:0817 VIA Labs, Inc.
|__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/2p, 5000M
ID 2109:0817 VIA Labs, Inc.
...
可以重复详细标志以获得更详细的输出:
$ lsusb -tvv
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
/sys/bus/usb/devices/usb2 /dev/bus/usb/002/001
|__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/1p, 5000M
ID 2109:0817 VIA Labs, Inc.
/sys/bus/usb/devices/2-2 /dev/bus/usb/002/002
|__ Port 1: Dev 4, If 0, Class=Hub, Driver=hub/2p, 5000M
ID 2109:0817 VIA Labs, Inc.
/sys/bus/usb/devices/2-2.1 /dev/bus/usb/002/004
|__ Port 5: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 0451:8140 Texas Instruments, Inc. TUSB8041 4-Port Hub
/sys/bus/usb/devices/2-5 /dev/bus/usb/002/003
|__ Port 3: Dev 5, If 0, Class=Hub, Driver=hub/4p, 5000M
ID 0451:8140 Texas Instruments, Inc. TUSB8041 4-Port Hub
/sys/bus/usb/devices/2-5.3 /dev/bus/usb/002/00/