An average Linux distribution has quite a few commands that allow you to list
hardware devices, like lshw, which gives an overview of all currently installed hardware.
LSCPU, which lists CPUs and their properties, or LSBLK for listing block devices.
LS PCI shows devices on the PCI bus, LSUSB devices gives a list of USB devices.
Then we have lsmem, which lists memory devices, and finally LS
initrd, which is showing what is inside the initrd file.
Remember, the initrd file is this file that is helping the kernel to boot properly. Let me show you these utilities,
but do notice that not all utilities by default installed on all distributions. So let's see how far we get.
So I'm using sudo I to start with.
No, let's not do that. Forget that.
So let me use lshw and lshw. Oh my goodness, do you see that? A lot
of information. But it's also telling us that you should run this program as super user.
So that means sudo lshw and I'm piping it through less because as you can see, it doesn't fit on one screen.
And here we have very detailed information about all the hardware in your system,
including the memory banks in your memory slots, you, name is there, I repeat,
really a lot of information, so much that it's a bit complicated.
You better use the more specialized commands if you're looking for something specific, like lscpu, which
is showing information about my cpu, this is merging the information from Prox cpuinfo with other
information that it has found to be as complete as possible about your cpu.
So look here it has found Apple Silicon. That's because even if I'm in virtualization, it
is directly addressing my Apple Silicon CPU. It has found two CPUs and we get information
about so much more, like the cache that it is using and so on.
Now LSBLK is listing block devices, we have already seen it lsblk,
which is convenient for managing removable devices, but also for hard disks.
And LSPCI is listing the PCI bus.
So you can just type LSPCI for a short list.
But in many cases you do this to figure out which kernel modules are loaded. And here we can see all the
different kernel modules that are available. We have already seen LSUSB for listening what is going on on the USB bus.
And a little bit less common is lsmem.
LSMEM is showing your memory configuration.
Now a memory configuration on a normal system is not spectacular,
but if you are using non uniform memory access or numa,
then LSMEM is giving interesting information about your memory topology.
And finally LS initrd is showing what is going on in the initrd.
The initrd is a complete file system that contains a directory structure, but it also contains drivers. And if ever
you need to figure out which drivers are available, well, look, here they are on the top of the list
and that might help you in determining if you need to install additional drivers to your init RD or not.
That's enough for the LIS hardware utilities. They are convenient and they really help in discovering what is going on on your.