lsusb
List USB devices and controllers attached to the system
By CMD Script Team · 4 min read · Last updated
lsusb [OPTIONS]Options
| Flag | Description |
|---|---|
-v | Verbose output, showing detailed descriptors for each device |
-t | Show a tree diagram of USB buses, hubs, and connected devices |
-d | Show only devices matching a given vendor:product ID, e.g. -d 046d:c52b |
-s | Show only the device at a given bus:device address, e.g. -s 001:004 |
-D | Show verbose info for a device given its device file path directly, e.g. -D /dev/bus/usb/001/004 |
Distribution compatibility
- Ubuntu
- Debian
- Fedora
- Arch
- macOS (not available; use system_profiler SPUSBDataType instead)
What it does
lsusb lists USB devices connected to the system — keyboards, mice, flash drives, USB
hubs, webcams, and the USB host controllers themselves. It reads device information from
the kernel's usbfs/sysfs interfaces and resolves vendor/product IDs into
human-readable names using the usb.ids database, similar in spirit to how lspci
works for the PCI bus. It's part of the usbutils package on most distributions.
Beginner examples
lsusb— list all connected USB devices with vendor/product IDs and nameslsusb -t— show devices as a tree reflecting USB bus/hub topologylsusb -v— show verbose descriptor details (often needssudofor full output)lsusb | grep -i logitech— find a specific device by name
lsusb
Advanced examples
- Show the tree with negotiated link speeds and driver info:
lsusb -tv - Get full descriptor detail for troubleshooting a misbehaving device (needs root for
complete output):
sudo lsusb -v -d 046d:c52b - Filter to a specific bus/device address found in a plain
lsusblisting:lsusb -s 001:004 -v - Diagnose a USB storage device not mounting by first confirming it's even detected:
lsusb | grep -i storage - Watch for a device appearing/disappearing (e.g. flaky USB connection) by re-running
lsusbafter replugging, or useudevadm monitorfor live events.
sudo lsusb -v -d 046d:c52b
Common mistakes
- Running
lsusband expecting to see internal PCI hardware like the GPU or network card — those live on the PCI/PCIe bus and appear inlspci, notlsusb. - Running
lsusb -vas a normal user and getting incomplete output without realizing root privileges are needed to read full device descriptors. - Assuming a device missing from
lsusboutput means faulty hardware, without first checkingdmesg/journalctlfor kernel-level USB errors (e.g. power negotiation failures) that occur before enumeration even completes. - Expecting
lsusbto work out of the box on macOS — it's a Linux-specific tool fromusbutils; macOS usessystem_profiler SPUSBDataTypeinstead.
Tips
- Use
lsusb -tfirst when troubleshooting hub/port issues — it shows exactly which hub and port a device is attached to, plus its negotiated speed. - Cross-check
lsusb's vendor:product ID againstdmesgoutput when a device isn't behaving, since kernel logs often reference the same ID. - Keep the
usb.idsdatabase current (often bundled with theusbutilspackage update) so devices resolve to friendly names instead of raw hex IDs.
Best practices
- When writing udev rules for a specific USB device, get its exact vendor:product ID
from
lsusbfirst rather than guessing or hardcoding a common value. - In hardware troubleshooting workflows, check
lsusbbefore diving intodmesg— confirm enumeration succeeded before investigating driver or permission issues. - Document vendor:product IDs (not just device names) in inventory or provisioning scripts, since names can vary slightly between systems while IDs stay constant.
Try it yourself
A simulated shell with a sample home directory — experiment freely, nothing leaves your browser. Type help to list supported commands.
Real-world use cases
- Diagnosing why a USB flash drive, webcam, or peripheral isn't being recognized by the system.
- Finding a device's vendor:product ID to write a matching udev rule for consistent permissions or device naming.
- Auditing which USB peripherals are connected to a server or workstation, especially in security-conscious environments.
- Confirming a USB device negotiated the expected speed (e.g. USB 3.0 at 5000M) rather than falling back to a slower mode.
Common interview questions
- What's the difference between
lsusbandlspci?lsusblists devices on the USB bus (keyboards, mice, flash drives, hubs);lspcilists devices on the PCI/PCIe bus (GPUs, network cards, storage controllers) — they enumerate different hardware buses. - How would you find a USB device's vendor and product ID? Run
lsusb; theID xxxx:yyyyfield in each line gives the vendor:product ID pair. - Why might
lsusb -vshow incomplete information for a normal user? Reading full USB device descriptors typically requires root privileges; running it withsudogets the complete verbose output.
Frequently Asked Questions
How do I see the USB device tree, including hubs?
Run lsusb -t, which shows a hierarchical tree of USB controllers, hubs, and the devices connected to each, along with the negotiated speed (e.g. 480M, 5000M) and driver in use for each branch.
How do I find the vendor and product ID for a specific USB device?
Plain lsusb output includes an ID field formatted as vendor:product (e.g. ID 046d:c52b), which you can then use to filter further with lsusb -d 046d:c52b or match against udev rules.
Why doesn't lsusb show any details for a device without sudo?
Basic identification (vendor/product ID and name) works for any user, but -v verbose descriptor details often require root privileges to read certain USB device files, so run lsusb -v with sudo for full output.
Cheat sheet
Download a quick-reference cheat sheet for lsusb.