Linux provides several ways to view detailed information about connected USB devices. This can help you identify hardware, troubleshoot issues, or monitor device status. Using built-in tools, you can quickly see essential details like device IDs, manufacturer information, and current power usage.

Most modern Linux distributions include commands to list and view USB device details without requiring additional software. These commands display comprehensive information about connected USB devices, including their hierarchy, bus location, and descriptors. Knowing how to access this data is valuable for system administrators and users who need to manage or troubleshoot USB devices.

Several tools like lsusb, dmesg, and usb-devices are available to gather information on connected USB devices. Each command offers different levels of detail and is useful in specific contexts. You can use these tools to gather details about both active and inactive devices, making it easier to troubleshoot issues.

Steps to view USB device details:

  1. Open the terminal.
  2. Use the lsusb command to list all connected USB devices.
    $ lsusb
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

    The lsusb command shows a summary of USB devices connected to the system, including their bus location, device number, vendor ID, and product ID.

  3. Use lsusb -t to display a tree view of USB device hierarchy.
    $ lsusb -t
    /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/4p, 480M
        |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M

    The lsusb -t option provides a tree-like structure showing which devices are connected to each USB port and their speed (e.g., 480M for USB 2.0).

  4. Use lsusb -v for verbose output of each connected device's details.
    $ lsusb -v
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            0
      bDeviceSubClass         0
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x046d Logitech, Inc.
      idProduct          0xc52b Unifying Receiver

    The -v option gives detailed information such as device descriptors, configurations, and interfaces. This is useful for analyzing specific device characteristics like power consumption.

  5. To filter the output of a specific USB device, use lsusb -d with the vendor and product ID.
    $ lsusb -d 046d:c52b
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

    The -d option filters the output to show details for a specific device, identified by its vendor and product ID.

  6. Use lsusb -s to display information for a device connected to a specific bus and device number.
    $ lsusb -s 002:003
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

    The -s option allows you to specify the bus and device number, useful when you know exactly which device you want to inspect.

  7. Optionally, combine lsusb with grep to search for specific devices by name.
    $ lsusb | grep Logitech
    Bus 002 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver

    This command is useful when you need to quickly find a specific USB device by its manufacturer or model name.

  8. Use the dmesg command to view kernel messages related to USB devices.
    $ dmesg | grep usb
    [    1.843250] usb 1-1: new high-speed USB device number 2 using ehci-pci
    [    1.972032] usb 1-1: New USB device found, idVendor=8087, idProduct=0024

    dmesg shows kernel log messages, which can help you see when a USB device was detected or if any errors occurred during initialization.

  9. Run the usb-devices command to get more detailed information about each connected USB device.
    $ usb-devices
    T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
    D:  Ver= 2.00 Cls=09(hub ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=8087 ProdID=0024 Rev= 0.00
    S:  Product=Integrated Rate Matching Hub

    usb-devices outputs detailed information about each connected USB device, including device class, vendor ID, and product ID.

Discuss the article:

Comment anonymously. Login not required.