Hardware Info Commands: lscpu, lsblk, lspci, lsusb, and dmidecode
Diagnosing a hardware problem, confirming a driver is loaded, or just documenting what is actually inside a machine are all things Linux handles well from the command line, without needing a graphical system information tool. This guide covers the five commands that answer nearly every “what hardware do I have” question: lscpu, lsblk, lspci, lsusb, and dmidecode.
lscpu: CPU information
lscpu
Output includes architecture, CPU model name, number of cores and threads, socket count, cache sizes at each level, and current operating frequency, formatted as clean labeled fields rather than raw kernel data:
Architecture: x86_64
CPU(s): 16
Thread(s) per core: 2
Core(s) per socket: 8
Model name: AMD Ryzen 7 5800X
CPU max MHz: 4850.0000
For the same underlying data in raw, per-core form directly from the kernel, cat /proc/cpuinfo lists every logical core individually, more verbose but occasionally containing fields lscpu does not surface, such as per-core flags.
lsblk: block devices and partitions
lsblk
Prints a tree view of every disk and partition on the system, with size and current mount point:
NAME SIZE TYPE MOUNTPOINT
sda 500G disk
├─sda1 512M part /boot/efi
├─sda2 50G part /
└─sda3 449G part /home
sdb 1.8T disk
└─sdb1 1.8T part /mnt/storage
Add -f to include filesystem type and UUID for each partition, useful when writing an /etc/fstab entry:
lsblk -f
Unlike df, which only shows currently mounted filesystems, lsblk shows the full device tree including unmounted and unformatted partitions, making it the better starting point when you are not sure what is even attached to the system.
lspci: PCI and PCIe devices
lspci
Lists every device on the PCI/PCIe bus, which covers most internal components: GPU, network adapter, sound card, storage controllers, and more:
01:00.0 VGA compatible controller: NVIDIA Corporation ...
02:00.0 Ethernet controller: Intel Corporation ...
Add -k to see which kernel driver, if any, is currently bound to each device:
lspci -k
01:00.0 VGA compatible controller: NVIDIA Corporation ...
Kernel driver in use: nvidia
Kernel modules: nouveau, nvidia_drm, nvidia
This is one of the fastest ways to confirm whether a GPU or other component has a working driver actually loaded, versus running undriven or with a fallback driver. -v adds more verbose detail per device, and -vv more still, for deeper hardware debugging.
lsusb: USB devices
lsusb
Lists every device connected via USB, with a bus and device number, vendor and product ID, and description:
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 002 Device 002: ID 8087:0aa7 Intel Corp. Bluetooth
If a USB device seems unrecognized, running lsusb before and after plugging it in confirms whether the kernel sees it at the USB level at all, narrowing a troubleshooting problem down to detection versus drivers versus the specific application trying to use it. Add -v for a much more detailed dump of a device’s descriptors, useful for deeper USB debugging.
dmidecode: full system hardware inventory
sudo dmidecode
dmidecode reads the DMI/SMBIOS tables, firmware-level data with information other tools cannot easily surface: exact motherboard model, BIOS/UEFI version, per-slot RAM details, and system serial numbers. It requires root, since it reads low-level firmware tables directly.
sudo dmidecode -t bios # BIOS/UEFI vendor and version
sudo dmidecode -t memory # installed RAM: slots, speed, manufacturer, size per module
sudo dmidecode -t system # system manufacturer, product name, serial number
sudo dmidecode -t baseboard # motherboard model and manufacturer
-t memory is particularly useful for confirming exactly which RAM modules are installed in which physical slots, including their rated speed, information not easily available from free or lscpu, which only report total memory and CPU details respectively.
Putting it together: a quick hardware audit
echo "=== CPU ==="; lscpu | grep "Model name"
echo "=== Memory ==="; free -h | grep Mem
echo "=== Storage ==="; lsblk
echo "=== GPU ==="; lspci | grep -i vga
echo "=== BIOS ==="; sudo dmidecode -t bios | grep -E "Vendor|Version"
A short script like this, chaining the tools covered here, produces a fast hardware summary useful for support tickets, inventory documentation, or just remembering what is actually inside a machine you set up a while ago.
Installing these tools if they’re missing
lscpu and lsblk are part of util-linux, present by default on essentially every distribution. lspci and lsusb come from separate packages, pciutils and usbutils, usually preinstalled on desktop distributions but sometimes absent from minimal server or container images:
# Debian/Ubuntu
sudo apt install pciutils usbutils dmidecode
# Fedora/RHEL
sudo dnf install pciutils usbutils dmidecode
# Arch
sudo pacman -S pciutils usbutils dmidecode
Frequently Asked Questions
How do I check what CPU my Linux system has?
Run lscpu, which prints a clean, structured summary: model name, architecture, number of cores and threads, cache sizes, and current clock speed. For the same information in a less structured but more granular format, straight from the kernel, cat /proc/cpuinfo lists details for every individual logical CPU core, which is more verbose but occasionally has fields lscpu does not surface. For most purposes, lscpu is the faster and more readable choice.
How do I list all storage devices and their partitions?
Run lsblk, which prints a tree view of every block device (disk or partition) along with its size, whether it is mounted and where, and its type (disk, partition, or logical volume). Add -f to include filesystem type and UUID for each partition, which is useful when preparing an /etc/fstab entry. lsblk is generally preferred over df for this purpose because it shows the full device tree including unmounted partitions, while df only shows currently mounted filesystems.
What is lspci used for?
lspci lists every device connected via the PCI or PCIe bus, which covers most internal hardware components: your graphics card, network adapter, sound card, storage controllers, and more. Each entry shows a bus address, a device class, and a vendor and model description. Add -k to also show which kernel driver is currently handling each device, which is one of the fastest ways to check whether a piece of hardware, most commonly a GPU, has a working driver loaded or is running without one.
How do I identify a USB device connected to my system?
Run lsusb, which lists every device connected via USB, showing a bus and device number along with a vendor and product ID and a description. If a USB device is not being recognized correctly, comparing lsusb output before and after plugging it in confirms whether the kernel is detecting it at the USB level at all, which helps narrow down whether a problem is with detection, drivers, or the specific application trying to use the device.
What does dmidecode show that other commands do not?
dmidecode reads hardware information directly from the system’s DMI/SMBIOS tables, firmware-level data that includes details other tools cannot easily surface, such as the exact motherboard model, BIOS/UEFI version, installed RAM module speeds and manufacturers per physical slot, and system serial numbers. It requires root privileges to run (sudo dmidecode) since it reads low-level firmware tables. It is particularly useful for checking installed memory details per slot (sudo dmidecode -t memory) or confirming BIOS version and vendor before a firmware update (sudo dmidecode -t bios).
Do I need to install these tools separately or are they built in?
lscpu and lsblk are part of util-linux, installed by default on essentially every Linux distribution. lspci and lsusb come from the pciutils and usbutils packages respectively, which are commonly preinstalled on desktop distributions but sometimes missing from minimal server or container images, in which case they can be installed with your package manager (e.g. apt install pciutils usbutils, or the dnf/pacman/zypper equivalent). dmidecode is its own separate package and is also frequently missing from minimal installs, following the same install pattern as lspci and lsusb.