Skip to content
Tutorials Center
My learning

Topics

Linux Command Reference ยท System Information

Linux lspci and lsusb commands

Reference for lspci and lsusb: list PCI and USB devices, show vendor IDs, drivers and the device tree with -v, -k, -nn and -t, and filter the output in scripts.

lspci lists the devices on the PCI bus (graphics cards, network adapters, storage controllers, and the chipset itself); lsusb lists devices on USB buses (keyboards, drives, webcams, hubs). Both translate numeric vendor and device IDs into names using a database that ships with pciutils and usbutils.

They read device information from /sys, so they work as a normal user. Containers and the sandbox on this site have no hardware view, so the commands are read-only examples here; the TryIts parse saved sample output the same way you would parse real output.

Terminal
lspci [-nn] [-k] [-v] [-t]
lsusb [-v] [-t] [-d VENDOR:PRODUCT]

Try it

Bash Read-only: parsing lspci style output

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Bash Read-only: parsing lsusb style output

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.

Syntax

Terminal
lspci [OPTIONS]
lsusb [OPTIONS]
Option Description
lspci -k Also show the kernel driver in use and the modules able to handle the device.
lspci -nn Show numeric [vendor:device] IDs next to the names.
lspci -v, -vv More detail: memory ranges, IRQ, capabilities (-vv or root may be needed for all).
lspci -t Draw the bus topology as a tree.
lspci -s SLOT Only one device, for example -s 00:02.0.
lsusb -t Tree of buses, hubs, devices and their drivers and speeds.
lsusb -d VID:PID Only devices matching a vendor and product ID.
lsusb -v Full descriptors (often needs root for every device).

Returns: 0 on success; non-zero if the bus cannot be read (for example lspci: Cannot find any working access method) or when lsusb -d finds nothing.

Usage notes

  • IDs are the stable key. Names come from a database that may be out of date. Use [vendor:device] pairs (-nn) in scripts and bug reports; run update-pciids to refresh names.
  • Drivers: lspci -k is the first thing to run when "the Wi-Fi doesn't work". A device with Kernel driver in use: missing has no active driver. See lsmod and modprobe.
  • Virtual machines show emulated or paravirtual devices (virtio, e1000). Containers see the host's /sys only if allowed; many show nothing.
  • Slot format is bus:device.function, optionally with a domain prefix (0000:00:02.0). The same string names the folder under /sys/bus/pci/devices/.
  • No PCI on some systems. Small ARM boards and some VMs have no PCI bus at all; lspci is then empty or fails, while lsusb or lsblk still work.
  • Not hot-plug events: these tools take a snapshot. Watch changes with udevadm monitor or by reading dmesg.
  • Related views: disks appear in lsblk, CPUs in lscpu, the whole machine in lshw or dmidecode (both need root).