
Understanding your system's hardware configuration is essential for developers and system administrators. Whether you're verifying hardware compatibility, diagnosing performance issues, or planning upgrades, Linux provides several built-in tools to inspect and report detailed hardware information.
This article demonstrates how to use common Linux utilities to generate system hardware reports, interpret the collected data, and export it in different formats for documentation or troubleshooting purposes.
To quickly view your system's hardware details without generating full reports, use these commands:
Linux offers several utilities for gathering detailed hardware information. Most distributions include some of them by default, but you can install all of them using your package manager.
Update the package list and install the required tools.
Follow these steps to enable required repositories and install the tools.
Enable the PowerTools repository.
For RHEL, the repository name differs. Enable the CodeReady Builder repository.
Install the perl-JSON-XS dependency.
Install the hardware reporting tools.
This section explores commands that help you analyze key hardware components, including CPU, memory, and firmware-level data. Use these tools to verify specifications, identify performance bottlenecks, or confirm hardware allocation in virtualized environments.
CPU (Central Processing Unit) is the core component responsible for executing instructions.
To view CPU architecture, model, core/thread count, and available instruction sets.
Output:
The lscpu utility gathers data from /proc/cpuinfo and system firmware. Key fields include:
The system’s RAM configuration affects overall performance and application responsiveness. You can monitor live usage and inspect physical memory modules using the following commands.
View real-time memory usage and swap utilization.
Output:
The free command displays memory statistics in a human-readable format. The "available" field shows the total memory that applications can still use without swapping.
Retrieve detailed information about installed DIMMs from system firmware.
Output:
The dmidecode command extracts firmware-level data (DMI tables) that include slot information, maximum capacity, and manufacturer details. This is useful for verifying the physical memory layout or identifying faulty modules.
Storage devices and mounted filesystems define how data is structured and accessed on a Linux system. Use these commands to list available disks, partitions, and mount points.
List all block devices with their size, type, filesystem format, and mount location.
Output:
The lsblk command displays block devices such as disks, partitions, and virtual volumes. Key fields include:
ext4, xfs, vfat). You can append -f parameter to the lsblk command to display the filesystem UUIDs and labels.
Display mounted filesystems and usage statistics by type.
Output:
The df command reports disk space usage for all mounted filesystems.
Key options:
-h: Displays sizes in a human-readable format (e.g., MiB, GiB).-T: Includes the filesystem type in the output.Network diagnostics are essential for verifying interface configuration, driver compatibility, and IP addressing. Use the following commands to inspect both logical and hardware-level details.
List all network interfaces with assigned IP addresses.
Output:
In the command above:
ip: Displays and manipulates network interfaces, routes, and addresses.-br: Enables brief mode, showing compact, colorized output.addr: Lists IP address information for each interface.Display hardware-level details for network interfaces.
Output:
In the command above:
lshw: Lists detailed hardware information.-class network: Filters output to only show network-related devices.These utilities provide an overview of the entire system's hardware configuration, from CPU and memory to storage, network, and sensors. They're especially useful for audits, documentation, or troubleshooting unfamiliar environments.
Readable, redacted system summary.
Output:
In the command above:
inxi: Generates a comprehensive but human-readable system report.-F: Displays full system information (CPU, memory, disks, network, etc.).-x: Adds extra details like kernel and driver versions.-z: Redacts sensitive information (serial numbers, MACs, etc.) for safe sharing.View hardware tree (complete system details).
Output:
In the command above:
sudo: Ensures access to restricted firmware and system data.lshw: Generates a detailed, hierarchical view of all detected hardware.Compact high-level snapshot of hardware components.
In the command above:
hwinfo: Probes and lists system hardware components.--short: Summarizes output into concise, per-device lines.In this section, you generate comprehensive hardware reports on your Linux system. The script automates data collection using tools like lshw, inxi, dmidecode, and hwinfo, then stores the output in a timestamped directory. It captures system details such as hostname, kernel version, operating system, CPU information, memory usage, and network configuration. The resulting reports provide a complete overview of your hardware for auditing or troubleshooting purposes.
Create a new shell script file.
Add the following script into the file. It collects detailed hardware information, organizes the reports, and compresses them into an archive.
Save and close the file.
Grant execute permissions to the script.
Run the script to generate the hardware reports.
Output:
The script creates a timestamped directory containing all hardware reports, then compresses it into a .tar.gz archive for easy backup or sharing.
This script uses -sanitize (for lshw) and -z (for inxi) to remove serial numbers and MAC addresses from the output. Review the generated files before sharing them if your environment treats device IDs or hostnames as sensitive data.
In this article, you generated complete hardware reports using built-in Linux utilities. Tools like lshw, inxi, and dmidecode alongside commands such as lscpu, free, lsblk, and ip help you document CPU, memory, storage, and network information efficiently. Archiving these reports improves audit readiness, troubleshooting, and system documentation.
0 Comments
Be the first to comment and share your perspective with the community.