There are many tools available for finding hardware specifications on Linux systems. Here, I’ve listed four of the most commonly used tools to capture almost all the hardware (and software) details of a Linux system. The good news is that these tools come preinstalled by default on some Linux distributions. I tested these tools on the Ubuntu 18.04 LTS desktop, but they also work with other Linux distributions.

1, LSHW

LSHW (Hardware List) is a simple but full-featured utility that provides detailed information on hardware specifications on Linux systems. It can report the exact memory specification, firmware version, motherboard specification, CPU version and speed, cache specification, bus speed, and so on. The information can be output in plain text, XML, or HTML.

It currently supports DMI (x86 and EFI only), Open Firmware device Tree (PowerPC only), PCI/AGP, ISA PnP (x86), CPUID (x86), IDE/ATA/ATAPI, PCMCIA (x86 only) ), USB, and SCSI.

As I’ve already said, Ubuntu comes preloaded with LSHW by default. If it is not installed on your Ubuntu system, use the following command to install it:

$ sudo apt install lshw lshw-gtk
Copy the code

On other Linux distributions, such as Arch Linux, run:

$ sudo pacman -S lshw lshw-gtk
Copy the code

After installation, run LSHW to find system hardware details:

$ sudo lshw
Copy the code

You will see output detailing the system hardware.

Example output:

Use LSHW to find hardware specifications on Linux

Please note that if you do not run the LSHW command with sudo permission, the output may be incomplete or inaccurate.

LSHW displays the output as an HTML page. To do this, use:

$ sudo lshw -html
Copy the code

Similarly, we can output the device tree as XML and JSON, as follows:

$ sudo lshw -xml
$ sudo lshw -json
Copy the code

To output the device tree showing the hardware path, use the -short option:

$ sudo lshw -short
Copy the code

Use LSHW to display a device tree with hardware paths

To list the device’s bus information, detailed SCSI, USB, IDE, and PCI addresses, run:

$ sudo lshw -businfo
Copy the code

By default, LSHW displays all hardware details. You can also use the class option to view hardware information for specific hardware details, such as processor, memory, display, and so on. Class options can be found using lshw-short or lshw-businfo.

To display specific hardware details, such as processors, do the following:

$ sudo lshw -class processor
Copy the code

Example output:

*-cpu
description: CPU
product: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
vendor: Intel Corp.
physical id: 4
bus info: [email protected]
version: Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
serial: To Be Filled By O.E.M.
slot: CPU 1
size: 913MHz
capacity: 2300MHz
width: 64 bits
clock: 100MHz
capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx lahf_lm epb pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid xsaveopt dtherm arat pln pts md_clear flush_l1d cpufreq
configuration: cores=2 enabledcores=1 threads=2
Copy the code

Similarly, you can get system details:

$ sudo lshw -class system
Copy the code

Hard drive details:

$ sudo lshw -class disk
Copy the code

Network details:

$ sudo lshw -class network
Copy the code

Memory details:

$ sudo lshw -class memory
Copy the code

You can also list details for multiple devices like this:

$ sudo lshw -class storage -class power -class volume
Copy the code

If you want to see details with hardware paths, add the -short option:

$ sudo lshw -short -class processor
Copy the code

Example output:

H/W path Device Class Description
=======================================================
/0/4 processor Intel(R) Core(TM) i3-2350M CPU @ 2.30GHz
Copy the code

Sometimes, you may want to share some hardware details with someone else, such as a customer support person. If so, you can remove potentially sensitive information from the output, such as IP addresses, serial numbers, and so on, as shown below.

$ lshw -sanitize
Copy the code

LSHW – GTK GUI tool

If you are not familiar with the CLI, you can use LSHW -gTK, which is the graphical interface of the LSHW command line tool.

It can be opened from a terminal or Dash.

To start it from the terminal, simply do the following:

$ sudo lshw-gtk
Copy the code

This is the default GUI interface of the LSHW tool.

Use LSHw-GTK to find hardware on Linux

Simply double-click “Portable Computer” to further expand the details.

Use the LSHw-GTK GUI to find hardware on Linux

You can double-click the subsequent hardware TAB to get a detailed view.

See the man page for more details.

$ man lshw
Copy the code

2, Inxi

Inxi is another of my favorite tools for finding almost everything on Linux systems. It is a free open source, fully functional command line system information tool. It shows system hardware, CPU, drivers, Xorg, desktop, kernel, GCC version, processes, RAM usage, and a variety of other useful information. Whether it’s the hard disk or the CPU, the motherboard or the full details of the entire system, INXI can display it more accurately in seconds. Since it is a CLI tool, you can use it in desktop or server versions. See the following guide for more details.

  • How do I use InXI to discover system details

3, Hardinfo

Hardinfo will provide you with system hardware and software details not available in LSHW.

HardInfo can gather information about system hardware and operating systems, perform benchmarks, and generate printable reports in HTML or plain text format.

If Hardinfo is not installed in Ubuntu, use the following command to install it:

$ sudo apt install hardinfo
Copy the code

After installation, the Hardinfo tool can be accessed from a terminal or menu.

Here’s what the default Hardinfo interface looks like.

Use Hardinfo to find hardware on Linux

As you can see in the screenshot above, Hardinfo’s GUI is simple and intuitive.

All hardware information is divided into four main groups: computers, devices, networks, and benchmarks. Each group displays specific hardware details.

For example, to view processor details, click the Processor option under the Devices group.

Use hardinfo to display processor details

Unlike LSHW, Hardinfo helps you find basic software specifications such as operating system details, kernel modules, locale information, file system usage, users/groups, and development tools.

Use Hardinfo to display operating system details

Another notable feature of Hardinfo is that it allows us to do simple benchmarks to test CPU and FPU functionality as well as some graphical user interface functionality.

Benchmarks are performed using Hardinfo

Recommended reading:

  • Phoronix Test Suite – Open source testing and benchmarking tools
  • UnixBench – A benchmark suite for Unix-like systems
  • How do I benchmark Linux commands and programs from the command line

We can generate reports for the entire system as well as individual devices. To generate a report, simply click the Generate Report button on the menu bar and select the information to include in the report.

Generate system reports using Hardinfo

Hardinfo also has several command-line options.

For example, to generate a report and display it in a terminal, run:

$ hardinfo -r
Copy the code

List modules:

$ hardinfo -l
Copy the code

Please refer to the manual for more information:

$ man hardinfo
Copy the code

4, the Sysinfo

Sysinfo is another alternative to the HardInfo and LSHw-GTK utilities and can be used to obtain the hardware and software information listed below.

  • System details, such as distribution version, GNOME version, kernel, GCC and Xorg, and host names.
  • CPU details, such as vendor identification, model name, frequency, L2 cache, model and logo.
  • Memory details, such as total system memory, available memory, total swap space and free, cached, active/inactive memory.
  • Storage controllers, such as IDE interfaces, all IDE devices, SCSI devices.
  • Hardware details such as motherboards, graphics cards, sound cards, and network equipment.

Let’s install sysinfo using the following command:

$ sudo apt install sysinfo
Copy the code

Sysinfo can be started from a terminal or Dash.

To start it from a terminal, run:

$ sysinfo
Copy the code

This is the default interface for the Sysinfo utility.

The sysinfo interface

As you can see, all hardware (and software) details fall into five categories: system, CPU, memory, storage, and hardware. Click the category on the navigation bar to get the appropriate details.

Use Sysinfo to find hardware on Linux

More details can be found on the manual.

$ man sysinfo
Copy the code

That’s all. As I already mentioned, there are many tools available for displaying hardware/software specifications. However, these four tools are sufficient to find all the hardware and software specifications for your Linux distribution.


Via: www.ostechnix.com/getting-har…

Sk Selected by Lujun9972

This article is originally compiled by LCTT and released in Linux China