Linux Hardware Commands: lscpu, lsusb, and lspci
This article explains how to inspect and inventory system hardware on
the Linux operating system using three essential terminal commands:
lscpu, lspci, and lsusb.
Together, these utilities allow system administrators and users to
identify processor architecture, internal PCI-connected components, and
external or internal USB peripherals directly from the command line
without installing third-party tools.
The lscpu Command: Inspecting the Processor
The lscpu command gathers CPU architecture information
from sysfs and /proc/cpuinfo and outputs it in
a clean, human-readable format. It is the primary tool for checking the
capabilities and topology of your system's processor.
What lscpu Displays:
- Architecture: Indicates whether the system is 32-bit (x86), 64-bit (x86_64), ARM, etc.
- Core and Thread Counts: Shows the number of CPU sockets, physical cores per socket, and threads per core (Hyper-Threading/SMT).
- Clock Speeds: Reports the current, minimum, and maximum CPU frequency in MHz.
- Cache Sizes: Details the capacities of L1d, L1i, L2, and L3 caches.
- Virtualization Flags: Confirms hardware virtualization support (VT-x or AMD-V), which is necessary for running virtual machines.
Useful Usage:
- Run
lscpuby itself for a complete summary. - Run
lscpu -eto view an extended, tabular format showing how CPUs map to physical cores and NUMA nodes.
The lspci Command: Identifying PCI Devices
The lspci command queries the PCI bus to display
information about all connected devices and controllers on the
motherboard. Because modern motherboards use PCI and PCI Express (PCIe)
for most high-bandwidth connections, this command reveals most internal
hardware.
What lspci Displays:
- Graphics Processing Units (GPUs): Dedicated and integrated video cards.
- Network Interfaces: Ethernet adapters and Wi-Fi controllers.
- Storage Controllers: SATA controllers, NVMe drives, and RAID controllers.
- Audio Devices: Integrated sound cards and high-definition audio controllers.
- Chipset Components: Host bridges, memory controllers, and PCI-to-PCI bridges.
Useful Usage:
- Run
lspcifor a compact one-line summary of each detected device. - Run
lspci -kto display the specific kernel drivers and modules currently handling each device, which is useful for driver troubleshooting. - Run
lspci -vorlspci -vvto generate detailed, verbose output, including subsystem IDs, memory addresses, and interrupt requests (IRQs).
The lsusb Command: Identifying USB Peripherals
The lsusb command interrogates the USB subsystem to list
all USB buses and the devices attached to them. This includes external
peripherals connected to physical ports as well as internal components
routed over USB internally, such as integrated webcams, Bluetooth
adapters, and fingerprint readers.
What lsusb Displays:
- Bus and Device Numbers: The logical bus and address assigned to each connected device.
- Device Identification (ID): A unique alphanumeric
string formatted as
VendorID:ProductID(e.g.,046d:c52b). This ID helps pinpoint exact hardware revisions when searching for drivers. - Manufacturer and Device Name: The reported brand and model of the peripheral.
Useful Usage:
- Run
lsusbto see a concise list of connected USB hubs and devices. - Run
lsusb -tto display a physical hierarchy tree showing which devices are connected to which USB controllers, ports, and operating speeds (e.g., 480M for USB 2.0, 5G/10G for USB 3.0+). - Run
lsusb -v -d [VendorID:ProductID](e.g.,lsusb -v -d 046d:c52b) to pull verbose descriptor data for a single specific device.