$linuxjunkies
>

lshw(1)

List detailed hardware information about the system including CPU, memory, disks, network devices, and more.

UbuntuDebianFedoraArch

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

FlagWhat it does
-shortShow brief information in a single line per device
-longShow detailed information in a longer format (default)
-htmlOutput in HTML format
-xmlOutput in XML format
-jsonOutput in JSON format
-class CLASSOnly show devices of specified class (e.g., processor, memory, disk, network)
-C CLASSShort form of -class
-c CLASSShow devices whose bus information matches CLASS
-disable NAMEDisable a specific capability or module for data collection
-numericShow numeric IDs instead of names

Examples

Display all hardware information in long format (requires root for complete details)

sudo lshw

Show a brief summary of all hardware in compact format

lshw -short

Display only CPU/processor information

sudo lshw -class processor

Display RAM and memory-related hardware

sudo lshw -class memory

Show all disk drives in brief format

sudo lshw -class disk -short

List all network interfaces and network devices

sudo lshw -class network

Export complete hardware information to JSON file for processing

sudo lshw -json > system.json

Show graphics card and display device information

lshw -class display

Related commands