Skip to content

This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!


lshw

lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory con‐figuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines.

It currently supports DMI (x86 and IA-64 only), OpenFirmware device tree (PowerPC only), PCI/AGP, CPUID (x86), IDE/ATA/ATAPI, PCM‐CIA (only tested on x86), SCSI and USB.

Reference(s)
  • man lshw

Table of contents


Install

# apk add lshw
# apt install lshw
# dnf install lshw
# emerge -a sys-apps/lshw
# nix-env -iA nixos.lshw
# nix-env -iA nixpkgs.lshw
# pacman -S lshw
# yum install lshw
# xbps-install -S lshw
# zypper install lshw

Use

  • Print help:

    $ lshw --help
    

  • Output hardware tree as HTML:

    $ lshw -html           
    

  • Output hardware tree as XML:

    $ lshw -xml
    

  • Output hardware tree as JSON:

    $ lshw -json
    

  • Remove sensitive information from output (like serial numbers, etc.):

    $ lshw -sanitize
    

  • Exclude volatile attributes (timestamps) from output

    $ lshw -notime
    


If this cheat sheet has been useful to you, then please consider leaving a star here.