lshw
Learn how to use the lshw command to display detailed information about your Linux system
Lshw Command Usage
The lshw
command (list hardware) is a powerful utility in Linux used to display detailed information about the hardware configuration of your system. It can provide comprehensive details about various hardware components, including CPU, memory, disk drives, network interfaces, and more.
Basic Hardware Information
To get a general overview of your system's hardware, you can run lshw
without any options. This will produce a detailed, hierarchical report.
# lshw
# Information about hardware configuration
# Generate full information report about all detected hardware.
lshw
Short Hardware Summary
For a more concise summary, use the -short
option. This is useful for quickly identifying key hardware components.
# Display brief hardware information.
lshw -short
Specific Hardware Class Information
You can filter the output to display information about specific hardware classes. For example, to view memory details:
# Display only memory information.
lshw -short -class memory
To display processor information:
# Display processor information.
lshw -class processor
To list disk drives:
# Display the disk drives with the disk class.
lshw -short -class disk
To get information about disks, storage controllers, and volumes:
# Display information about the partitions and controllers also, specify the
# storage and volume class along with the disk class.
lshw -short -class disk -class storage -class volume
To view network adapter details:
# Network adapter information.
lshw -class network
Bus Information
The -businfo
option displays the address details of various devices, such as PCI, USB, SCSI, and IDE devices.
# Display the address details of PCI, USB, SCSI and IDE devices.
lshw -businfo
Generating Reports
lshw
can also generate reports in different formats, which is useful for documentation or sharing hardware information.
# Generate report in HTML format.
lshw -html > hardware.html
# Generate report in XML format.
lshw -xml > hardware.xml