lsusb

hardware informationLinux
The lsusb command is one of the most frequently used commands in Linux/Unix-like operating systems. lsusb List USB devices

Quick Reference

Command Name:

lsusb

Category:

hardware information

Platform:

Linux

Basic Usage:

lsusb [options] [arguments]

Common Use Cases

    Syntax

    lsusb [options]

    Options

    Option Description
    -v, --verbose Increase verbosity (show detailed information)
    -s [[bus]:][devnum] Show only devices with specified bus and/or device number
    -d [vendor]:[product] Show only devices with the specified vendor and/or product ID
    -D device Show only the device specified by its device file
    -t Show USB devices in a tree format
    -V, --version Show version information
    -h, --help Show help message

    Examples

    How to Use These Examples

    The examples below show common ways to use the lsusb command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    # Basic Examples Basic
    lsusb
    Display a summary of all USB devices.
    lsusb -v
    Show detailed information about all USB devices.
    # Advanced Examples Advanced
    lsusb -t Show USB devices in a tree format. lsusb -d 1234:5678 Show only the device with vendor ID 1234 and product ID 5678. lsusb -s 1:3 Show only the device connected at bus 1, device 3. lsusb -v -s 2:4 | grep iSerial Extract the serial number of a specific USB device. lsusb -v | grep -A 5 "Interface Descriptor" List all interface descriptors with 5 lines of context. lsusb -D /dev/bus/usb/001/004 Show detailed information about a specific device using its device file. lsusb -v -d 046d: | grep -i "product" Show product information for all Logitech devices (vendor ID 046d).

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    The 'lsusb' command is a utility for displaying information about USB buses in the system and the devices connected to them. It's part of the usbutils package and is available on most Linux distributions. lsusb provides valuable information for diagnosing issues with USB devices and understanding the USB device hierarchy in a system. Key features of the lsusb command: 1. USB Device Enumeration: lsusb identifies and lists all USB devices connected to the system, including internal devices like webcams, Bluetooth adapters, and external peripherals like mice, keyboards, and storage devices. 2. Device Identification: The command displays vendor and product IDs for each device, which can be used to identify specific hardware models and find appropriate drivers or troubleshooting information. 3. Hierarchical Display: With the -t option, lsusb shows the tree structure of USB buses, hubs, and devices, making it easy to visualize how devices are physically connected to the system. 4. Detailed Device Information: Using the -v (verbose) option, lsusb provides extensive details about each device, including its USB version compatibility, power requirements, supported speeds, and configuration descriptors. 5. Filtering Capabilities: The command allows filtering output to show only specific devices based on bus number, device number, or vendor/product IDs, which helps focus on devices of interest in systems with many USB peripherals. 6. USB Protocol Analysis: In verbose mode, lsusb shows low-level USB protocol information, including device, configuration, interface, and endpoint descriptors, which is valuable for developers and advanced troubleshooting. 7. Human-readable Output: lsusb translates numeric vendor and product IDs into human-readable names using a database of USB IDs (usually located at /usr/share/hwdata/usb.ids). Common use cases for lsusb include: - Identifying connected USB devices - Checking if a USB device is properly detected by the system - Troubleshooting non-functioning USB peripherals - Finding vendor and product IDs to search for drivers - Verifying USB device capabilities (like speed support) - Diagnosing power-related issues with USB devices - Developing and debugging USB drivers lsusb is particularly useful for system administrators, hardware technicians, and Linux users who need to troubleshoot USB connectivity issues or gather information about their system's USB configuration. It provides insights that might not be readily available through graphical system information tools, especially for complex USB setups with multiple hubs or composite devices.

    Related Commands

    These commands are frequently used alongside lsusb or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the lsusb command works in different scenarios.

    $ lsusb
    View All Commands