Managing inherited Linux systems often means starting from scratch with hardware documentation. While CPU-z excels on Windows, Linux offers several powerful alternatives that provide even deeper system insights through command-line tools and GUI applications.
For quick hardware inventories via SSH or scripts, these CLI tools are indispensable:
# CPU Information (like CPU-z's first tab)
lscpu | grep -E 'Model name|Socket|Core|Thread|Vendor'
# Detailed memory configuration
sudo dmidecode --type memory
# PCI devices listing (GPUs, network cards, etc.)
lspci -v | less
For those preferring a CPU-z-like interface, install hardinfo:
sudo apt install hardinfo # Debian/Ubuntu
sudo dnf install hardinfo # Fedora
Key features mirroring CPU-z:
- Interactive hardware tree navigation
- Benchmarking tools
- HTML export capability
- Real-time sensor monitoring
Generate comprehensive XML/JSON inventories for documentation:
sudo lshw -html > system_inventory.html
sudo lshw -json > hardware.json
Example parsing the JSON output with jq:
sudo lshw -json | jq '.children[].product' # List all hardware products
For multiple inherited systems, automate the process:
---
- name: Gather hardware facts
hosts: inherited_servers
tasks:
- name: Collect CPU info
ansible.builtin.command: lscpu
register: cpu_info
- name: Save hardware report
ansible.builtin.copy:
content: "{{ cpu_info.stdout }}"
dest: "/reports/{{ inventory_hostname }}_hardware.txt"
Unlike CPU-z's real-time monitoring, Linux offers lm-sensors:
sudo sensors-detect
watch -n 1 sensors
When managing multiple Linux systems (especially inherited ones), having accurate hardware information is crucial for:
- Driver compatibility checks
- Performance optimization
- Capacity planning
- Troubleshooting hardware issues
Before looking at GUI tools, these terminal commands provide quick hardware snapshots:
# CPU information
lscpu | grep -E 'Model name|Socket|Core|Thread|MHz'
# Memory details
sudo dmidecode --type memory | grep -E 'Size|Type|Speed'
# Disk configuration
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,FSTYPE,MODEL
1. HardInfo
The closest Linux equivalent to CPU-z with detailed reporting:
# Installation on Debian/Ubuntu
sudo apt install hardinfo
# Generate HTML report (like CPU-z)
hardinfo -r -m devices.so -f html > hardware_report.html
Features:
- Benchmarking tools
- PCI/USB device trees
- Sensor monitoring
2. inxi (Terminal-based Powerhouse)
# Install on most distros
sudo apt install inxi # or use your package manager
# Full system report (pipe to less for readability)
inxi -Fxxxza
Example filtered output for CPU:
inxi -Cxxx
CPU:
Info: 6-core model: AMD Ryzen 5 5600X bits: 64 type: MT MCP arch: Zen 3
rev: 2 cache: L1: 384 KiB L2: 3 MiB L3: 32 MiB
Speed (MHz): avg: 2200 min/max: 2200/4650 boost: enabled cores: 1: 2200
2: 2200 3: 2200 4: 2200 5: 2200 6: 2200
For scripting and automation:
# Install if not present
sudo apt install lshw
# JSON output for parsing
sudo lshw -json
# Short summary
sudo lshw -short
# Filter specific components
sudo lshw -class cpu -class memory
Combine tools for comprehensive documentation:
#!/bin/bash
REPORT_FILE="system_inventory_$(date +%Y%m%d).txt"
{
echo "===== SYSTEM INVENTORY REPORT ====="
echo "Generated: $(date)"
echo "\n----- CPU -----"
lscpu
echo "\n----- Memory -----"
sudo dmidecode --type memory
echo "\n----- Storage -----"
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL,SERIAL
echo "\n----- GPU -----"
lspci -vnnn | grep -i VGA -A 12
} > "$REPORT_FILE"
For multiple machines, use this playbook snippet:
- name: Gather hardware facts
hosts: all
tasks:
- name: Collect CPU info
ansible.builtin.command: lscpu
register: cpu_info
- name: Save inventory
ansible.builtin.copy:
content: |
{{ inventory_hostname }}
{{ cpu_info.stdout }}
{% for disk in ansible_devices %}
Disk {{ disk }}: {{ ansible_devices[disk].size }}
{% endfor %}
dest: "/tmp/{{ inventory_hostname }}_inventory.txt"