lshw command

lshw command get hardware information on linux

lshw command get hardware information on linux

Lshw – List hardware

This command will display detail information of hardware in your system. It can give memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc.

Install lshw

Ubuntu, Debian and Fedora users can install by running below command.
# ubuntu, debian

sudo apt-get install lshw 

# fedora, centos (epel)

sudo yum install lshw 

Using lshw

lshw run as root or sudo gives the maximum amount of information,

1. Get full information

Running lshw without any options would give full information about all detected hardware.

sudo lshw 

hardware information linux | lshw

2. Get information in short

With the help of “-short” it will give a brief information report about the hardware devices.

sudo lshw -short 

hardware information linux | lshw

3. Get only memory information

To display information about the memory, specify the memory class

sudo lshw -short -class memory 

hardware information linux | lshw

4. Get processor information

With class processor, lshw would display information about the cpu. It is better to not use the short option and get full details about the processor.

sudo lshw -class processor 

hardware information linux | lshw

5. Disk drives

Display the disk drives with the disk class.

sudo lshw -short -class disk 

hardware information linux | lshw

Get information about the partitions and controllers also, specify the storage and volume class along with the disk class.

sudo lshw -short -class disk -class storage -class volume 

hardware information linux | lshw

 

8. Generate report in html/xml format

Lshw is capable of producing reports in html, xml and json formats.

sudo lshw -html > hardware.html 

For xml format

sudo lshw -xml > hardware.xml 

You May Also Enjoy Reading This …