When working on a Linux distribution, the user may need to know about hardware and basic system information of the current working system. Regardless of whether you are a software developer or a normal Linux user, it might be necessary to check software and hardware system compatibility. The command-line Linux system provides built-in commands through which a user can get the details about the currently used system and hardware platform.

In this article, you will find a brief description of all commands, which will help you easily get details about your system and hardware.

We have run these commands on the CentOS 8 system, which are listed below:

Displaying the hardware information using CentOS 8

There are the following commands which are used to display detailed information about your system hardware:

Display hardware details using lshw command

Using ‘lshw’ command, you can fetch all necessary hardware details from your system such as CPU, memory, disks, etc. To get the system’s hardware information, run the command as superuser which is given below:

$ sudo lshw

Mostly, the ‘lshw’ utility is already installed on your CentOS 8 system. If it is not installed then you can install it on CentOS 8 using the following command:

$ sudo yum install lshw

Output:

The lshw command

The above-shown output is a detailed version of the hardware details of my CentOS 8 system that is installed on the Virtual box. Using the following commands you can view the complete summary of hardware.

Display hardware summary

To view the complete summary of hardware profile details, use the following command:

$ lshw -short

Output:

Hardware detail summary

In the above-displayed output, you can see a summary of the complete hardware profile in column-wise which is more readable.

Retrieve hardware details in HTML file of your system

Using ‘lshw’ utility, you can also print the hardware profile details to an HTML file. For this purpose, as a superuser run the ‘lshw’ command by using the following syntax:

$ sudo lshw -html > [filename.html]

Example:

$ sudo lshw -html > hardwareinformation.html

After successfully executing the above command, the HTML file has been created in your system at the location /home/user/ folder.

Output:

Hardware details as html file

Display CPU details with ‘lscpu’

Using ‘lscpu’ utility, you can list the details information of CPU from the sysfs and /proc/cpuinfo files to your screen. Use this command as follows:

$ lscpu

Output:

lscpu result

The above-mentioned command will display the CPU architecture, cores, CPU family model, number of CPUs, threads, caches, and much more.

Block device information

Using ‘lsblk’ utility, you can display the information about storage devices that are connected to your system such as hard drive, flash drives, drive partitions, etc.

$ lsblk

Using the following command you can view much more information about all the system’s devices:

$ lsblk -a

Output:

Block device information

Display USB controller details

The ‘lsusb’ command is used to list the information about USB controllers and the devices that are connected with them. Execute the following command to get the USB controller information:

$ lsusb

Display USB controller details

Using the following command you can view the more details about each USB device.

$ lsusb -v

Output:

Detailed USB controller report

The above output displays the USB controllers and connected devices.

Display details about other hardware devices

You can also display information about the following devices:

  1. PCI devices
  2. SCSI devices
  3. SATA devices

To display the information about PCI devices use the following command:

$ lspci

Output:

Display details about other hardware devices

To get information about SCSI devices, you will run the command as follows:

$ lsscsi

Output:

SSI details

To view, the information about SATA devices use the following syntax:

$ hdparm [devicelocation]

For example, use the command

$ hdparm /dev/sda1

After implementing all the above-mentioned commands, you will be able to retrieve any kind of information related to your system on CentOS 8 or other Linux environments. This article will help you to view system specifications in order to check that the entire software or hardware system is compatible with your needs or not.

How to get system hardware details on CentOS 8
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.