Lsusb command in Linux: USB connected devices

Introduction

In Linux systems, hardware management is a key task for advanced administrators and users. Knowing which USB devices are connected allows you to diagnose problems, set up peripherals and optimize system performance.

What is lsusb?

The commandlsusbbelongs to the packageusbutilsand shows detailed information about USB buses and devices connected to them. Use the bookstorelibusbto read the structure of the USB tree exposed by the kernel.

Installation

In most modern distributions,usbutilsIt's already pre-installed. If not present, just run:

  • Debian / Ubuntu:sudo apt-get install usbutils
  • Fedora:sudo dnf install usbutils
  • Arch Linux:sudo pacman -S usbutils

Basic use

Runlsusbwithout arguments list all USB devices detected:

lsusb

The typical output has the format:

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

Most commonly used options

  • -vor--verbose: shows detailed descriptors of each device.
  • -tor--tree: presents information in the form of a tree, showing the hierarchy of hubs and ports.
  • -s [[bus]:][dev]: filters the exit to a specific bus or device.
  • -d [vendor]:[product]: shows only the devices that match the manufacturer and product ID.
  • -V: print the version ofusbutils.

Practical examples

  • See the device tree:lsusb -t
  • Get detailed information from a hub:lsusb -v -s 001:002
  • List only devices of a particular manufacturer (e.g. Logitech ID 046d):lsusb -d 046d:
  • Save output in a file for further analysis:lsusb > usb_report.txt

Interpretation of the exit

Each line starts withBus XXX Device YYY: ID abcd:efgh Fabricante Nombre del producto. The first four hexadecimals (abcd) correspond to the manufacturer's ID (selling ID) and the following (efgh) to product ID (product ID). These IDs are essential for looking for drivers or checking compatibility.

When used-v, output includes configuration descriptors, interfaces, endpoints and features such as current consumption, speeds (Low, Full, High, SuperSpeed) and serial numbers.

Tips and tricks

  • Combinelsusbwithgrepto search quickly:lsusb | grep -i keyboard
  • Usewatch -n 1 lsusbto monitor real-time changes when connecting or disconnecting devices.
  • In administration scripts, check the presence of a device before performing actions:if lsusb -d 046d:c52b > /dev/null; then echo 'Ratón Logitech detectado'; fi
  • Remember that some devices can appear multiple times due to composite functions (e.g. a webcam with microphone).

Conclusion

The commandlsusbis a simple but powerful tool to inspect the status of the USB bus in Linux. Dominating your options allows you to diagnose faults, manage peripherals and automate hardware management tasks efficiently.

This work is under aCreative Commons License Attribution 4.0 International for Francesc Roig francesc @ vivaldi.net.

EnglishenEnglishEnglish