Have you ever found yourself in a situation that required you to find out some information about your server’s hardware and did not have the documentation handy? In some cases, the documentation may even be too generic, covering multiple models. In such a circumstance, you can either crack open the server and take a peek inside or, more practically, use a tool like lshw to print out the information you need right on your screen.
Since lshw is not installed by default in Red Hat Enterprise Linux or CentOS, you will need to add a package repository like RPMforge in order to install it. After you have added the repository, simply run:
# yum install lshw
The lshw package is available in the stable Debian repositories, and you can install it with:
# apt-get install lshw
Once installed, simply run the command (preferably as root):
You will receive detailed information about your hardware, including OEM information provided by the OEM, details about your motherboard, RAM, CPU, storage, and other internal devices.
You can use a few key options with the command to customize the output:
lshw -html will output to an HTML page
lshw -xml will show an XML tree
lshw -short will show the hardware paths
For more information about lshw, type “man lshw” for the command line or view the online documentation.