How to Retrieve Hardware Specifications on Linux and Embedded Systems

When debugging, deploying, or documenting an embedded system or Linux machine, you need to know what hardware you are working with: CPU type and speed, available memory, storage capacity, connected peripherals, and kernel configuration.

This guide provides practical commands and file locations to retrieve all critical hardware information on Linux-based systems, from servers to embedded devices.


1. CPU Information

Basic CPU Info

# Detailed CPU information
lscpu

# Raw CPU data
cat /proc/cpuinfo

# CPU architecture
uname -m

What you get: CPU model, cores, threads, architecture (ARM, x86_64, RISC-V), frequency, cache sizes, flags (NEON, AVX, FPU).

Example Output (ARM Cortex-A53)

Architecture:        aarch64
CPU(s):              4
Model name:          Cortex-A53
CPU MHz:             1200.000
L1d cache:           32 KiB
L1i cache:           32 KiB
L2 cache:            512 KiB

CPU Temperature and Frequency (Embedded)

# Current frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq

# CPU temperature (if available)
cat /sys/class/thermal/thermal_zone0/temp  # In millidegrees

# All thermal zones
for zone in /sys/class/thermal/thermal_zone*/temp; do
  echo "$zone: $(cat $zone)"
done

2. Memory (RAM) Information

Memory Capacity and Usage

# Human-readable memory info
free -h

# Detailed memory breakdown
cat /proc/meminfo

# Memory hardware details
dmidecode -t memory  # Requires root on x86

What you get: Total RAM, used/free memory, swap, buffers, caches, memory type (DDR3/DDR4), speed.

Example

$ free -h
              total        used        free      shared  buff/cache   available
Mem:          1.9Gi       450Mi       1.2Gi        12Mi       300Mi       1.3Gi
Swap:            0B          0B          0B

Memory Map (Embedded Systems)

# View memory layout
cat /proc/iomem

# Check for reserved memory regions
dmesg | grep -i reserved

3. Storage and Disk Information

Block Devices (Disks, eMMC, SD Cards)

# List all block devices
lsblk

# Detailed disk info with filesystem
lsblk -f

# Disk usage per partition
df -h

# Physical disk details
fdisk -l  # Requires root

Flash Memory Info (Embedded)

# Check for MTD devices (NOR/NAND flash)
cat /proc/mtd

# MTD partition details
cat /proc/mtd | awk '{print $1, $2, $4}'

# NAND flash info
nand-utils  # If available

Storage Device Details

# SMART data (SSD/HDD health)
smartctl -a /dev/sda  # Requires smartmontools

# I/O statistics
iostat -x 1

Example Output

$ lsblk
NAME         MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
mmcblk0      179:0    0  29.7G  0 disk
├─mmcblk0p1  179:1    0   256M  0 part /boot
└─mmcblk0p2  179:2    0  29.5G  0 part /

4. Hardware Peripherals

PCI Devices (x86/x64 Systems)

# List all PCI devices
lspci

# Detailed PCI info
lspci -v

# Specific device info
lspci -nn | grep -i ethernet

USB Devices

# List USB devices
lsusb

# Detailed USB tree
lsusb -t

# Verbose device info
lsusb -v

All Hardware Overview

# Comprehensive hardware list (requires lshw)
lshw -short

# Full detailed hardware tree
lshw -html > hardware.html  # Export to HTML

5. Network Interfaces

# Network interface details
ip addr show

# Or old-style
ifconfig -a

# Ethernet hardware info
ethtool eth0  # Link speed, duplex, driver

# Wireless interfaces
iwconfig

# MAC addresses
ip link show | grep link/ether

Example

$ ip addr show eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
    link/ether b8:27:eb:a3:c2:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global eth0

6. Kernel and OS Version

# Kernel version
uname -r

# Full system info
uname -a

# OS distribution
cat /etc/os-release

# Kernel build configuration
cat /boot/config-$(uname -r) | grep -i <feature>

# Loaded kernel modules
lsmod

7. Embedded-Specific Hardware Info

Device Tree (ARM/Embedded)

# View compiled device tree
dtc -I fs /sys/firmware/devicetree/base

# Device tree source (if available)
cat /proc/device-tree/model

# List all device tree nodes
ls -R /sys/firmware/devicetree/base/

GPIO Information

# GPIO chip info
gpioinfo

# Export and control GPIO (legacy sysfs)
ls /sys/class/gpio/

# Available GPIO chips
cat /sys/kernel/debug/gpio

I2C and SPI Devices

# I2C buses and devices
i2cdetect -l
i2cdetect -y 1  # Scan bus 1

# SPI devices
ls /dev/spidev*
cat /sys/class/spi_master/spi0/spi0.0/modalias

Serial Ports

# List serial devices
ls /dev/tty*

# Detailed UART info
setserial -g /dev/ttyS*

8. Power and Battery (Embedded/Laptop)

# Battery status
cat /sys/class/power_supply/BAT0/capacity
cat /sys/class/power_supply/BAT0/status

# All power supplies
ls /sys/class/power_supply/

# Power consumption (if supported)
cat /sys/class/power_supply/BAT0/power_now

9. Complete System Summary (Quick Commands)

One-Line Hardware Summary

# CPU + Memory + Disk in one view
echo "CPU: $(nproc) cores | RAM: $(free -h | awk '/^Mem:/ {print $2}') | Disk: $(df -h / | awk 'NR==2 {print $2}')"

Full Hardware Report Script

#!/bin/bash
echo "=== System Hardware Report ==="
echo "Hostname: $(hostname)"
echo "Kernel: $(uname -r)"
echo "Architecture: $(uname -m)"
echo ""
echo "=== CPU ==="
lscpu | grep -E 'Model name|CPU\(s\)|CPU MHz'
echo ""
echo "=== Memory ==="
free -h | grep -E 'Mem|Swap'
echo ""
echo "=== Storage ==="
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT
echo ""
echo "=== Network ==="
ip -br addr show
echo ""
echo "=== USB Devices ==="
lsusb

10. Tools Summary

ToolPurposePackage
lscpuCPU detailsutil-linux
lsblkBlock devicesutil-linux
lspciPCI devicespciutils
lsusbUSB devicesusbutils
lshwFull hardware inventorylshw
dmidecodeBIOS/SMBIOS info (x86)dmidecode
ethtoolNetwork interface detailsethtool
smartctlDisk healthsmartmontools
i2cdetectI2C bus scanningi2c-tools
gpioinfoGPIO infolibgpiod
/proc/*Kernel runtime infoBuilt-in
/sys/*Sysfs device infoBuilt-in

11. Installation of Diagnostic Tools

Debian/Ubuntu

sudo apt update
sudo apt install lshw pciutils usbutils i2c-tools smartmontools ethtool

Fedora/RHEL

sudo dnf install lshw pciutils usbutils i2c-tools smartmontools ethtool

Embedded (Buildroot/Yocto)

Add these packages to your build configuration:

BR2_PACKAGE_LSHW=y
BR2_PACKAGE_PCIUTILS=y
BR2_PACKAGE_USBUTILS=y
BR2_PACKAGE_I2C_TOOLS=y

12. Common Use Cases

Debugging “Unknown Device”

lsusb -v | less       # Find VID:PID
lspci -nn             # Find PCI IDs
dmesg | tail -50      # Recent kernel messages

Pre-Deployment Hardware Check

# Run all critical checks
lscpu && free -h && lsblk && ip addr && lsusb

Production System Documentation

# Export hardware inventory
lshw -xml > system-$(hostname)-$(date +%F).xml

Remote Hardware Inspection (SSH)

ssh user@device "lscpu && free -h && df -h && ip addr"

Summary

Linux provides rich hardware introspection through:

  • Command-line tools: lscpu, lsblk, lspci, lsusb, lshw
  • Pseudo-filesystems: /proc/*, /sys/*, /dev/*
  • Embedded-specific: Device tree, GPIO, I2C/SPI tools

Whether you are working on a Raspberry Pi, an industrial ARM board, or a server, these commands give you complete visibility into your hardware without opening the case or reading the vendor documentation.

Bookmark this guide and keep these commands ready for debugging, deployment, and documentation tasks.