lshw(1)
List detailed hardware information about the system including CPU, memory, disks, network devices, and more.
Synopsis
lshw [OPTION]... [-class CLASS]...Description
lshw (list hardware) is a small tool to extract detailed information about the hardware configuration of a machine. It can output the information in different formats for easy parsing by other programs or for direct human reading.
The hardware is organized in a tree of classes. lshw uses DMI data, SMBIOS tables, kernel modules, and /proc interfaces to gather system information. Some information requires root privileges to access.
Common options
| Flag | What it does |
|---|---|
-short | Show brief information in a single line per device |
-long | Show detailed information in a longer format (default) |
-html | Output in HTML format |
-xml | Output in XML format |
-json | Output in JSON format |
-class CLASS | Only show devices of specified class (e.g., processor, memory, disk, network) |
-C CLASS | Short form of -class |
-c CLASS | Show devices whose bus information matches CLASS |
-disable NAME | Disable a specific capability or module for data collection |
-numeric | Show numeric IDs instead of names |
Examples
Display all hardware information in long format (requires root for complete details)
sudo lshwShow a brief summary of all hardware in compact format
lshw -shortDisplay only CPU/processor information
sudo lshw -class processorDisplay RAM and memory-related hardware
sudo lshw -class memoryShow all disk drives in brief format
sudo lshw -class disk -shortList all network interfaces and network devices
sudo lshw -class networkExport complete hardware information to JSON file for processing
sudo lshw -json > system.jsonShow graphics card and display device information
lshw -class display