Get Hardware Info [hwlist]


How To Find Out Hardware Information In A Linux System

<< Recently updated >>

(Easy to find CPU/memory module  part/serial number etc,.)

--"-- hwlist command --"--




*** Simple | Easy to install | User-friendly | runs on RHEL 8 as well ***

This command (hwlist) has been tested to run successfully on Linux variants such as RHEL 8/7/6, SLES/SLED 12/11, Mint16, Ubuntu 18/16/14, BOSS 6(Debian) etc., running on 64/32 bit architectures. It may work on other variants as well, however, not tested. These tests were done on a virtual machine.  This is a small, simple command which makes use of native Linux utilities to get the required details. Now, it is easy to find CPU/RAM module manufacturer, serial number, part number etc., Also, this could help in finding server serial number, manufacturer and other details as explained further down.

Simply install 'hwlist-2.2-0.noarch.rpm' package on your Linux system and then run the 'hwlist' command.

Package Details:


Package Name: hwlist-2.2-0.noarch.rpm

Build To Run On: RHEL 8/7/6, SLES/SLED 11/12,  CentOS, OEL, Ubuntu 18/16/14, and other Debian based systems x86 & x86_64 architectures.

Who Can Run This Command : Root User or a sudo user.

Output: When this package is installed, the "hwlist" command would be available to run. This gets created in "/usr/bin" directory by default.


How to install hwlist package?

To install this package, download the package and run either 'yum' or 'rpm' to get it installed on compatible Linux systems. It would need 'dmidecode', 'smartmontools', & 'sysstat' packages as dependency. These packages would get installed by default (on standard installation) unless modified and they are part of the default server ISO image.


Let's install hwlist package now:-

We could simply run the command as shown below to get both the key and package installed:-

# rpm --import \
https://github.com/SimplyLinuxFAQ/hwlist/releases/download/v2.2/RPM-GPG-KEY-hwlist

# rpm -Uvh \
https://github.com/SimplyLinuxFAQ/hwlist/releases/download/v2.2/hwlist-2.2-0.noarch.rpm


Otherwise, we could use the 'yum' command to get this installed. We may either download both the keys and packages first and then run 'yum install hwlist-2.2-0.noarch.rpm' or run yum directly using the link as shown below (later import the keys):




The 'hwlist' package and GPG key files could be downloaded directly using the "wget" command as shown below if necessary:

# wget https://github.com/SimplyLinuxFAQ/hwlist/releases/download/v2.2/hwlist-2.2-0.noarch.rpm

This would download 'hwlist-2.2-0.noarch.rpm' file to the current working directory. Similarly, download the GPGkey using 'wget' as :

# wget https://github.com/SimplyLinuxFAQ/hwlist/releases/download/v2.2/RPM-GPG-KEY-hwlist


Once the 'hwlist-2.2-0.noarch.rpm' package and required GPG keys are loaded into the system, let’s verify if the package is installed successfully using the command 'rpm -qi hwlist' as shown below:



Importance of package signature:- It is important to get proper signature keys to be imported to the system to verify package integrity. So, we need make sure to download the “RPM-GPG-KEY-hwlist” (key) to the 'rpmkeyring' of the system so that the downloaded package could be verified against tampering. Otherwise, signature verification on the package would report an error message (missing keys) as shown in the below snap:



So, download the key and import into the system rpm keyring and then verify the package integrity, and this time it should pass. This would prove the package integrity against unauthorized sources of tampering. It would be a good practice to do this before installing the package.



Now, the "hwlist" command is available which is installed in "/usr/bin" directory as shown below:-



Installing package on SuSE systems:- Use ‘zypper install <PackageName>’ command to get the package installed on SLES systems.

Installing package on Debian systems:- On Debian based system, one could use ‘alien’ to convert a '.rpm' package into '.deb' file. If ‘alien’ command is not available then install this first using the command “apt-get install alien”. Later run the command “alien <packagename>" to convert it into '.deb' file which can be installed using “dpkg -i <debfile>” as shown in below snap (though the snap shot shows installation of older hwlist version, same process is applicable for installing newer version as well):
NOTE:- For older versions of Red Hat such RHEL5.x one could still use the earlier "hwlist.sh" script which can downloaded from the earlier release file from the github page provided at the bottom of this page.
How does this works?

This is a user-friendly, interactive, simple command which needs an  argument to be passed to get the results. This would help someone who is looking to get information about system hardware such as RAM (primary memory), CPU (processor), hard drives, PCI devices, network adapter & interface details etc,.  This would also print details of operating system such as file system usage, I-node usage, currently mounted file systems, number of zombie process found, load average, CPU & swap usage data, top processor/memory consuming processes etc,.

When called without arguments the "hwlist" command would simply print out a short help message as shown below:-

Get Help:- Run this command with “--help OR --info” as an argument to get more info or help. This would open up the help page of 'hwlist' command that can be scrolled up/down, otherwise hit 'q' to quit the page.
So, pass the argument as desired to get the required details. For example, to print processor (CPU) details such as CPU Manufacturer, Serial Number etc., run the command 'hwlist --cpu' as shown in the below snap shot :-

Likewise, to get details about Operating System such as Linux Variant, Hostname, Server Manufacturer, Server Serial Number etc., and to get system BIOS details call the command with “--system” as an argument as shown below :-


NOTE:- This command can list out multipathed drives (if available) separate and network bonding interfaces would get listed out separately.

To dump all the details into a text file for later reference or to send it to somewhere else, one could do so now by using '--dump' parameter with a file name where the output to be stored as shown in the below picture :-


The above command would dump all hardware & operating system details on to file "/tmp/hardware-details.txt" which is a simple text file with complete details.

Direct Download-Link:


There is a bundled tar file named 'hwlist-2.2.tar.gz' which got two files, a binary rpm "hwlist-2.2-0.noarch.rpm" & "RPM-GPG-KEY-hwlist" GPG public key file which can be downloaded using the direct download link given below.


View the main github page: https://github.com/SimplyLinuxFAQ/hwlist

All the best!
*Please pass on your feedback on how it works to SimplyLinuxFAQ@gmail.com

19 comments:

Puran singh said...

Good one, thanks for sharing

My OCP4 Project said...

Thanks Puran.

J Balajee said...

Sir, can u give the script for shutdown all ubuntu system from server in lab send to this mail id
jbbala@gmail.com

My OCP4 Project said...

Balajee,

Please check my recent post: http://simplylinuxfaq.blogspot.in/2015/02/how-to-shutdown-remote-system-via-ssh-without-password.html

Thanks,
Sadashiva Murthy M

karthi said...

Hi Siva bro Nice post especially i liked your script ... Motivating too...visit my blog https://autellinux.wordpress.com/ .... I also try scripting my expectation in hardware related script filed in your blog.. thanks for your explained post

Anonymous said...

good one..

Anonymous said...

Awesome script. Could you update the script to collect temperature and fan speed?

Unknown said...

I am unable to run this script.

: command not found
: command not found
'wlist.sh: line 37: syntax error near unexpected token `
'wlist.sh: line 37: `head_fun()

My OCP4 Project said...

Please check the script file that you are running. Sometimes, when script file gets copied or moved, some extra characters gets added at the end of each line. Check this and make sure no such characters are added up. Also, make sure indentation is not altered when you copy file.

ychaouche said...

Hello and thank you so much for this script, best output I could get from all other scripts I have tried :

hwlist.sh <- top, strips off uninstalled modules
dmidecode <- best, not too much details
hwinfo <- good, too much detail
inxi <- very readable
lshw <- not very informative


Anonymous said...

Useful script. thank you

Anonymous said...

One of the best sites for Unix. Neat and clear explanation of topics.
Thanks for explaining the hwlist.sh script.

sagar

Unknown said...

Good Document about hwlist, thanks for sharing the detailed instruction.

Anonymous said...

Very helpful indeed.

Charanjit Singh Cheema said...

Very informative article. Really helpful for System Admin in their daily task.

cl-netbox said...

Having tested hwlist on RHEL 8 Beta, I have to say : great tool - very useful ... well done, Sadashiva ! :)

SimplyLinuxFAQ said...

Thank you Christian, Charan and Raghu....

Anonymous said...

Nice tool...

Alejandro Forteza said...

Very informative article. Really helpful for System Admin in their daily task.