19

Is there any tool which lists the controller, hubs and devices of USB subsystem in their tree structure at the shell?

lsusb lists flatly and does not show all the details. usbview has a GUI, but shows the tree structure and all details of the devices. Any tool that shows whatever usbview does, but at the shell?

2 Answers2

30

-t shows tree output:

$ 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

This also shows the current speed, so you can see e. g. keyboard and mouse with 12 Mbps.

Use -tv for more verbose output, including class descriptors (vendor):

$ 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. 
...

The verbose flag can be repeated for even more detailed output:

$ 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/
Tombart
  • 1,009
Rolf
  • 429
  • 4
  • 6
  • 11
    lsusb -t loses the human readable device descriptors that lsusb shows. Add -v to get them back, or lsusb -tv – Guss Dec 25 '19 at 09:00
0

You can use cyme instead. It's written to be a lsusb replacement on macOS (you know how buggy the mac lsusb script is) but works on various platforms and has a lot more features. It even has a --lsusb for the lsusb-compatible mode

cyme tree sample output

Note that you need nerd fonts for the nice symbolic characters

phuclv
  • 758