Linux online course

Display USB Device Information in Linux with lsusb

Learn how to use lsusb to list USB devices, inspect descriptors, understand USB topology, and troubleshoot detection on physical and virtual Linux systems.

What USB detection means in Linux

USB means Universal Serial Bus. It is a hardware interface used to connect peripherals such as keyboards, mice, printers, storage devices, cameras, and network or display adapters.

When you connect supported USB hardware, the Linux kernel normally detects it automatically. The kernel identifies the device, creates an entry in the USB device system, and may load a suitable driver.

Detection is not the same as full usability. A device can appear in the USB device list while still needing one or more additional steps:

  • A storage device may need to be recognized as a block device and mounted.
  • A printer, camera, or audio device may need application or subsystem configuration.
  • A device may be detected without a suitable kernel driver.
  • A user-space application may need permission to access the device.

The lsusb command focuses on USB enumeration: whether Linux can see the USB device and what information the device reports.

What is lsusb?

lsusb is the standard Linux command-line utility for listing USB devices known to the system. It is commonly supplied by the usbutils package.

The default listing usually includes the USB bus number, device number, hexadecimal vendor and product IDs, and a human-readable device name.

A vendor ID is a hexadecimal identifier assigned to a hardware manufacturer. A product ID is a hexadecimal identifier assigned by that vendor to a particular product or device function. Together, they commonly appear in the form vendor:product, such as 1234:abcd.

List connected USB devices

Run the command without options to display a concise list:

lsusb

A typical line might look like this:

Bus 001 Device 004: ID 1234:abcd Example Manufacturer USB Keyboard

Read the line from left to right:

Output elementMeaningExample format
Bus numberThe logical USB bus associated with a host controller.Bus 001
Device numberThe address currently assigned to the device on that bus.Device 004
Vendor IDThe hexadecimal identifier for the hardware manufacturer.1234
Product IDThe hexadecimal identifier for the vendor's product or device function.abcd
Human-readable labelA descriptive vendor and product name, when available.Example Manufacturer USB Keyboard

Output depends on the machine. Integrated devices, attached hubs, internal cameras, wireless adapters, removable peripherals, and virtual hardware can all affect the result. Device numbers can also change after reconnecting hardware or restarting the system, so treat them as temporary identifiers.

Useful lsusb options

Command or optionPurposeTypical use caseNotes
lsusbList detected USB devices.Get a quick inventory.Shows bus, device, IDs, and labels.
lsusb -vDisplay verbose USB descriptor information.Inspect one or more devices in detail.Output can be very long; use a pager or filter.
lsusb -tDisplay the USB hierarchy as a tree.Find controllers, hubs, ports, and attached devices.Useful for understanding physical or virtual attachment paths.
lsusb -d vendor:productFilter by hexadecimal vendor and product IDs.Inspect a specific device family or function.Use IDs copied from a normal lsusb listing.
lsusb -s bus:deviceSelect a device by bus and device number.Inspect the device at a particular current address.Numbers can change when the device reconnects.

Inspect USB descriptors with lsusb -v

A USB descriptor is structured metadata reported by a USB device. Descriptors describe the device's identity, configurations, capabilities, and functional interfaces.

Use -v for extensive information:

lsusb -v | less

The verbose output may include:

  • USB specification version and device class.
  • Vendor, product, and serial-number strings when the device provides them.
  • Power requirements and configuration values.
  • Interfaces for functions such as storage, keyboard input, audio, or networking.
  • Endpoints, which are USB communication channels used to transfer data between the host and device.
  • Driver-related information when the system exposes it.
  • Configuration, interface, and endpoint descriptor fields.

The less pager lets you move through the output without flooding the terminal. Press Space to move forward, b to move backward, and q to quit.

To inspect only a known device, first obtain its IDs from lsusb, then run:

lsusb -d 1234:abcd -v

You can also select the current bus and device address:

lsusb -s 001:004 -v

View USB controller and hub topology

Use -t to display USB devices in a hierarchy:

lsusb -t

The tree represents how USB connections branch:

  • A host controller is hardware that manages USB communication for part of the system.
  • A root hub is the hub represented by a host controller. Its ports are the starting points for that controller's USB branches.
  • An external USB hub expands one connection into multiple downstream ports.
  • A directly attached peripheral appears below the controller or root hub port to which it is connected.
  • A downstream peripheral appears below an external hub when it is plugged into that hub.

A simplified physical arrangement looks like this:

Computer host controller
└── Root hub
    ├── Keyboard
    └── External hub
        ├── Mouse
        └── Storage device

Topology output commonly includes a port number, device number, link speed, device class, and driver. The port identifies the branch position. The device number identifies the current USB address. Speed indicates the negotiated connection speed. Class describes the broad USB function, and driver identifies an associated kernel driver when available.

ComponentRole in the treeWhat it may represent
Host controllerManages USB communication for a bus.USB controller hardware provided by the computer or virtualization platform.
Root hubProvides the controller's starting hub and ports.An integrated hub associated with the host controller.
External hubBranches one upstream connection into multiple downstream ports.A powered or unpowered physical USB hub.
Directly attached peripheralAppears immediately below the controller or root hub branch.A keyboard, mouse, camera, or storage device plugged into a computer port.
Downstream peripheralAppears below an external hub branch.A device connected through that hub.

Topology is useful when several devices are connected. It can show whether a peripheral is sharing an external hub, which controller manages it, and whether Linux sees a hub between the computer and the device.

Physical computers and virtual machines

On a Linux system running directly on a computer, lsusb can show the computer's real USB controllers, root hubs, and attached physical hardware.

In a virtual machine, the guest may instead see emulated USB controllers or virtual devices supplied by the virtualization platform. A physical device connected to the host is not automatically visible inside the guest.

USB pass-through is a virtualization feature that makes a physical host USB device available to a guest operating system. Some platforms call a similar feature USB redirection. The virtual machine configuration may need a USB controller enabled and the specific device assigned to the guest. After assignment, reconnecting the device or changing its host attachment may be necessary.

Investigate a newly connected device

A simple before-and-after comparison often identifies a newly attached peripheral:

lsusb; echo '--- connect the device, then run again ---'; lsusb

Compare the two lists and look for a new line. Copy its vendor and product IDs for targeted inspection:

lsusb -d 1234:abcd -v

You can also compare the topology before and after connecting a hub or peripheral:

lsusb -t

For additional detection information, inspect recent kernel messages:

dmesg | tail -n 50

On systems using the systemd journal, an alternative is:

journalctl -k -n 50

Seeing a device in lsusb confirms that USB enumeration occurred. It does not guarantee that Linux created a usable device node or interface. For example, a storage device may need to appear as a block device before it can be mounted, and a network adapter may need a network interface and driver.

Install lsusb when it is unavailable

If the shell reports that lsusb is not found, install the usbutils package using the package manager for your distribution.

Debian- and Ubuntu-based systems:

sudo apt install usbutils

Fedora and similar distributions:

sudo dnf install usbutils

Arch-based systems:

sudo pacman -S usbutils

After installation, run:

lsusb

Troubleshoot missing or unusable USB devices

The lsusb command is not found

The usual cause is that usbutils is not installed, especially on a minimal Linux image. Install the package appropriate for the distribution and run lsusb again.

A connected device does not appear

Possible causes include a faulty cable, port, adapter, hub, or peripheral; insufficient power; a hardware or firmware problem; or a device that is connected to the host while Linux is running in a virtual machine.

  1. Reconnect the device.
  2. Try another USB port and, if possible, another cable.
  3. Test without an unpowered hub or use an adequately powered hub.
  4. Compare lsusb output before and after connection.
  5. Review dmesg | tail -n 50 or journalctl -k -n 50.
  6. In a virtual machine, verify USB pass-through or redirection and confirm whether the device is assigned to the host or guest.

If enumeration still fails, test the device on another system to separate a host-side problem from a device-side problem.

The device appears but does not work

Visibility in lsusb means that the device responded to USB enumeration. The required kernel driver may still be missing or may have failed to bind. The device may also need subsystem configuration, mounting, permissions, or application-specific setup.

Start with the topology and logs:

lsusb -t
dmesg | tail -n 50

Review the driver field where shown, then investigate the relevant subsystem: block devices for storage, input devices for keyboards and mice, audio devices for sound hardware, printing for printers, or networking for adapters.

Verbose output is incomplete

Some descriptor fields require elevated access, and some details are limited by the device or kernel. Compare normal and privileged output:

lsusb -v | less
sudo lsusb -v | less

Use sudo only for the command that needs it. Missing fields do not always indicate a malfunction.

A virtual machine shows unexpected USB devices

The guest may be seeing emulated devices rather than the host's physical peripherals. Inspect lsusb -t, check the virtual USB controller configuration, and verify device assignment. Configure pass-through for the desired physical device and reconnect it to the appropriate system.

Key points to remember

  • lsusb lists USB devices that Linux has detected through USB enumeration.
  • The default output includes a bus number, device number, vendor ID, product ID, and descriptive label.
  • lsusb -v displays descriptors, interfaces, endpoints, power information, and other detailed fields.
  • lsusb -t shows host controllers, root hubs, external hubs, ports, and downstream devices.
  • Vendor and product IDs are hexadecimal identifiers useful for filtering and research.
  • A device appearing in lsusb does not prove that its driver, device node, mount, permissions, or application setup is complete.
  • Virtual machines may require USB pass-through or redirection before a guest can see a physical peripheral.

For more command-line practice, see Linux command-line fundamentals and Bourne Again Shell Bash.