Collecting hardware information with lshw and inxi under Linux

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

The tool lshw, the abbreviation stands for list hardware, creates detailed listings that it retrieves from the virtual /proc directory.[1] inxi is a command line tool, it is often pre-installed in some distributions, but can be easily upgraded via package management.[2] It can be used to display hardware information (with different coloring) on the command line. This article shows how to install and use both tools under Ubuntu and Debian, respectively, as well as under Red Hat Enterprise Linux and CentOS.

Installation of lshw and inxi

To use lshw and inxi, use the package manager to perform the installation from the repositories.

  • Ubuntu / Debian based systems:
$ sudo apt install lshw lshw-gtk inxi
  • RHEL / CentOS:
# yum install lshw inxi
(The EPEL repository from the Fedora Project needs to be added under CentOS 7 / 64Bit to install the package inxi) Add EPEL Repository
    # wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    # rpm -ivh epel-release-latest-7.noarch.rpm

    # yum --enablerepo=epel info inxi 

    # yum install inxi

Usage of lshw

Graphical output of lshw

After a successful installation, lshw can be executed with root privileges in a terminal and the best way is to redirected to a file for further processing.

Output possibilities

The tool also offers several output options:

  • Graphically-based / Desktop (Package lshw-gtk must be installed)
  • HTML-based (output tree structure)
  • Text-based (command line prompt)

Examples

Output of lshw redirected to an HTML file

Below are some examples of how to use lshw.

  • Graphical output
# lshw -X
  • HTML output (redirection into a file):
# lshw -html > lshw_ausgabe.html
  • Normal text output (redirection into a file):
# lshw > lshw_output.txt
  • Short output:
# lshw -short
  • Output only a specific hardware class:
# lshw -c CPU

Usage of inxi

Output of inxi

In order to get fast a hardware information of an available system, the Tool inxi is suitable. It is equipped with a large number of parameters, which can be specified on the command line.

Examples

Below you will find some examples of how to use inxi.

  • Overview about the system:
# inxi -pluFxxrm

In this output you will find information about partitions, operating system, resource consumption, memory usage and also information about the repositories used.

References

  1. lshw (ezix.org)
  2. inxi (smxi.org)
Foto Wilfried Seifert.jpg

Author: Wilfried Seifert

Wilfried Seifert, working in the Systems Engineering department at Thomas-Krenn, is responsible for system/prototype development in his work area. LPIC 3 certified, deals with construction / programming of embedded / GPIO systems; in his spare time he likes to repair old home computers, attends Linux conferences or is on the road with his bike (MTB) for sporting compensation.


Related articles

Bash history
Using rdiff-backup under Linux
Vi editor tips and tricks