You get a bonus - 1 coin for daily activity. Now you have 1 coin

Linux Debian/CentOS lshw: Viewing Detailed Hardware Information

Practice



Let's look at using the lshw utility. So, we have a task - to analyze the hardware of a computer running Debian (or ubuntu) or CentOS (or Red Hat). There is no GUI, in this case we assume the analysis is needed for a computer that is a server.

How can we find out the CPU model, the motherboard model, which memory modules are installed, how many there are, and which controllers are connected? And all this in Linux Debian or CentOS?

The lshw utility will help us with this.


Installing

Debian (or ubuntu)

$ sudo aptitude install lshw


CentOS (or RedHat)

$ sudo yum install lshw


Using it

It's quite simple just to run the utility. It is located at the path "/usr/sbin/lshw" in CentOS - which is important if you are working under an RHEL-compatible OS, since there, "out of the box", it will not even run under a plain sudo.

In Debian it is installed at "/usr/bin/lshw", which allows you to run the utility simply with sudo.

CentOS:

$ sudo /usr/sbin/lshw


Debian:

$ sudo lshw


Such a command will output all the possible information, so I recommend doing it like this:

$ sudo /usr/sbin/lshw | less


or

$ sudo /usr/sbin/lshw | more


in order to see the output page by page.


Less detailed output

For this, we use the -short parameter:

Debian:

$ sudo lshw -short


CentOS:

$ sudo /usr/sbin/lshw -short


Well, that's all. From here you can use it yourself. More info, as always, via man lshw.


PS. Under Debian, running in paravirtualized mode under Xen, the utility simply hangs, whereas in CentOS it shows that this is a Xen machine.

1) Displaying full information

Simply by typing the lshw command, you will get all the detected hardware details.

centos

description: Computer

*-core

*-firmware

*-cpu

2) Displaying information briefly

As you can see, this amount of information is difficult to read on one screen. This short command can be used to get summary information about the system's hardware.

$ lshw -short

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

3) Displaying memory information only

We can list information about the memory and memory class.

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

4) Displaying CPU information

CPU information can be displayed using the cpu class. Note, don't use the short option in order to get complete information.

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

5) Disk drives

We can also get information about storage and the volume class along with the disk class. This will give a clearer picture of the storage in the system.

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

6) Network adapter information

The network class provides information about the network adapter / interface. It's better not to use the short option to get complete information.

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

7) Displaying address details using businfo

To get detailed information about pci, usb, scsi and ide devices, you can specify them using the businfo parameter.

Linux DebianCentOS lshw: Viewing Detailed Hardware Information

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Diagnostics, maintenance and repair of electronic and radio equipment"

Terms: Diagnostics, maintenance and repair of electronic and radio equipment