brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: lshw -short gives a one page overview of the hardware inside a PC

Hardware
~/tips/tip-hardware-lshw-short

sudo lshw -short

List the machine's parts with their device names in one table.

Before I order a part or reuse an old PC, I want to know what is inside without opening the case. lshw reads it all out.

sudo apt install lshw
sudo lshw -short

The table shows the hardware path, the device name, the class and a description: processor, memory, disks, network ports, graphics and more. Narrow it to one class:

sudo lshw -class network
sudo lshw -short -class disk -class storage

The long form for a class adds details such as the driver, the capabilities and, for network cards, the link state.

To share the report, ask it to strip the private bits:

sudo lshw -sanitize > hardware.txt

The man page says this removes things like IP addresses and serial numbers. There is also -html if you want a page to keep with your notes.

Run it with sudo. Without root it only reports part of the information and warns you about that. Read a shared file once yourself, since I would not trust any automatic cleanup completely. In a virtual machine you see the virtual devices, which tells you little about the real server underneath.

Further reading: lshw man page

More Hardware tips disable_poe_fan=1 sudo dmidecode -s bios-version rfkill list udevadm monitor Get-CimInstance Win32_BIOS | Select-Object Manufacturer, SMBIOSBIOSVersion, ReleaseDate, SerialNumber All Hardware tips (8) All topics

Link