lshw Command
Intermediate System Information man(1)List detailed hardware configuration
👁 10 views
📅 Updated: Mar 15, 2026
SYNTAX
lshw [OPTION]...
What Does lshw Do?
lshw (list hardware) displays detailed information about the complete hardware configuration of the machine. It reports on memory, CPU, disks, network interfaces, graphics, and all other hardware components.
lshw reads from /proc, /sys, DMI tables, and other sources to build a comprehensive hardware inventory. It requires root for complete information — without root, some details are missing.
lshw is essential for hardware inventory, capacity planning, troubleshooting driver issues, and documenting server specifications.
lshw reads from /proc, /sys, DMI tables, and other sources to build a comprehensive hardware inventory. It requires root for complete information — without root, some details are missing.
lshw is essential for hardware inventory, capacity planning, troubleshooting driver issues, and documenting server specifications.
Options & Flags
| Option | Description | Example |
|---|---|---|
| -short | Show brief hardware summary | sudo lshw -short |
| -class | Show specific hardware class | sudo lshw -class memory |
| -html | Output as HTML | sudo lshw -html > hardware.html |
| -json | Output as JSON | sudo lshw -json |
| -sanitize | Remove sensitive info (serial numbers) | sudo lshw -sanitize |
| -businfo | Show bus information | sudo lshw -businfo |
Practical Examples
#1 Brief summary
Shows a concise hardware inventory.
$ sudo lshw -short
Output:
H/W path Class Description
/0/0 memory 16GiB System Memory
/0/1 processor Intel Core i7
/0/100/1f.2 storage SATA Controller
#2 Memory details
Shows detailed memory configuration including slots and modules.
$ sudo lshw -class memory#3 Network hardware
Shows network interface details including driver, speed, and MAC address.
$ sudo lshw -class network#4 Disk information
Shows disk hardware details including model, serial, and capacity.
$ sudo lshw -class disk#5 HTML report
Creates a comprehensive HTML hardware report.
$ sudo lshw -html > /tmp/hardware.html#6 Bus information
Shows hardware tree organized by bus connections.
$ sudo lshw -businfoTips & Best Practices
Use -short for quick overview: sudo lshw -short gives a one-line-per-device summary. Much easier to scan than the full output.
Requires root: Run with sudo for complete information. Without root, many details are unavailable or shown as Unknown.
Alternative tools: lscpu for CPU, lsblk for disks, lspci for PCI devices, lsusb for USB. lshw shows everything but specialized tools have more detail.
Frequently Asked Questions
How do I check hardware specs?
sudo lshw -short gives a quick overview. For specific hardware: sudo lshw -class memory, -class processor, -class disk.
How do I find RAM details?
sudo lshw -class memory shows total RAM, speed, type (DDR4), and which slots are populated.
How do I generate a hardware report?
sudo lshw -html > report.html creates a detailed HTML report of all hardware.
Related Commands
More System Information Commands
Master Linux with Professional eBooks
Curated IT eBooks covering Linux, DevOps, Cloud, and more
Browse Books →