This article covers some of the ways to check hardware information in Linux.

These commands are simple but can be used to check every hardware details of your machine. It’s not only useful to someone working on VMs and as a system admin, but also to normal user.

If I find a old PC and want to revive it with a lightweight linux distribution, the first thing I do is create a Live USB and run a live session. I, then, go ahead and check the hardware specifications to determine which Linux distribution it can handle. These commands to check hardware information in Linux are very useful during that time.

Below list only contains the very basic of what these terminal commands does. You can always read the manual to learn more about them. For example, you can run below command to check for the first one lsblk. If you are using them in script, you can check various options that can be used with these commands.

man lsblk 

Now, lets check some of the options to check hardware information in Linux.

lsblk

lsblk lists out information about all available block devices. In simple terms, it shows the storage devices and the partitions you have created, including mounted / unmounted file systems.

Since I didn’t go for a partition in my Ubuntu server, you could see the sda filesystem with root and /boot.

lsblk comes pre-installed in Ubuntu server and in all the Linux distributions.

lsblk
check hardware information in Linux - lsblk

df

df checks the disk space of all the filesystem and displays the size, used and available limits. To print the output in human readable format, you can use below command.

df -h

You can see the various filesystems and how much its available to use.

df - disk space check

lscpu

One of the way to check hardware information in Linux is using lscpu. It’s available by default and gives you enough information about architecture, CPU operating mode, Vendor and model name etc. Here’s a screenshot of what it reads of my VM.

ambarish@ubuntusever:~$ lscpu
lscpu - check hardware information in Linux

inxi

inxi is a command line system information script built for console and IRC. It can be used to check system hardware, CPU, drivers, Xorg, Desktop, Kernel, RAM and processes among other useful information. To install inxi you can use below command.

sudo apt install inxi

Once installed you run it from terminal to give you a brief system information.

inxi
inxi - simple

For detailed hardware information

inxi -Fxz
inxi - detail output

hwinfo

hwinfo is another userful to check hardware information in your Linux system. It details the CPU information, Keyboard/Mouse/Monitors and Graphics card details. I personally like it more than others because of it’s easy to read result and it pretty much displays what I need to know as a user. Use below command to install it

sudo apt install hwinfo

Once done, you can use this command to append the output in a text file to read it or check it in console.

hwinfo --short > info.txt
hwinfo - check hardware information in Linux -

Not for hardware but still useful – top

top command is not really a hardware information tool but rather a runtime way to check CPU and memory usage. It’s like a task manager of windows but only better. If you work on a server, I’m sure you use it on daily basis. It lists out all the processes running, how much CPU and Memory they are using individually and displays the overall consumption of CPU and RAM of your system.

Wrapping Up

I’m sure I have missed a lot of other tools that can be used to check hardware information. Let me know in the commends and I will try to include them in this list.

Btw, which one is your go-to?