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 configuration, 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.

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 memory-related hardware:

    $ lshw -class memory           
    

  • Output cpu-related hardware:

    $ lshw -class cpu 
    

  • Output disk-related (CD, DVD, ...) hardware:

    $ lshw -class disk
    

  • Output storage-related hardware:

    $ lshw -class storage
    

  • Ouput availables class:

    $ lshw -short
    

  • 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.