If you are using Linux, you may need to know details about the system or the hardware specifications you are using. As a regular Linux user or software developer, it is important that you check the compatibility of any software or hardware system that you want to install. The Linux command line contains several built-in commands that help you become familiar with the software and hardware platform you are working on. This tutorial will teach you how to use these commands to get the sysinfo Linux details.
The commands and examples to get hardware specs from Linux in this tutorial have been tested on Ubuntu 22.04 and Debian 11.
To know the basic information about your system, you need to be familiar with the command-line utility called uname-short for unix name.
The uname command comes with multiple switches. The basic command as described below only returns the Kernel name:
$ uname
Output:
As you can see, the uname command when used without any switches only returns the kernel name i.e., Linux for my system.
When you precisely want the command to print the kernel name, you will use the following command:
$ uname -s
Output:
The above output has displayed Linux as my kernel name.
In order to print the release information of your kernel, use the following command:
$ uname -r
Output:
The above command has displayed the release number of my Linux
To fetch the version of your kernel, use the following command:
$ uname -v
Output:
The above output shows the version number of my kernel.
You can use the following command to print the network hostname of your node:
$ uname -n
You can also use the following command for the same purpose as it is more user-friendly:
$ uname --nodename
Output:
Both commands will display the same output. Please note that the host and node names might not be the same for non-Linux systems.
In order to know the hardware architecture of the system you are working on, please use the following command:
$ uname --m
Output:
The output x86_64 signifies that I am using a 64-bit architecture. The output i686 means that a user is on a 32-bit system.
To know the type of processor you are using, please use the following command:
$ uname -p
Output:
This output shows that I am using a 64-bit processor.
To know the hardware platform you are using, please use the following command:
$ uname -i
Output:
In my case, the output is the same as that of the machine hardware name.
The following command will let you know the name of the operating system you are using:
$ uname -o
Output:
My Ubuntu machine has displayed the above output for my system.
The above commands have displayed system information as per the type of switch used. In case you want to see all the system information at once, use the following command:
$ uname -a
Output:
You can see that the above output shows the complete list of system information for the user.
Here we will describe the commands, other than uname, that are used to extract detailed hardware information of your system:
The lshw utility lets you fetch important hardware information, such as memory, CPU, disks, etc., from your system. Please run the following command as a super user to view this information:
$ sudo lshw
Output:
The above output is a very detailed version of the hardware information of my system. You can also view a summary to list only specific hardware components of hardware information as described in the following section.
In order to view the summary of your detailed hardware profile, please use the following command:
$ lshw -short
Output:
The above output is a column-wise summary of the hardware profile which is more readable.
The lshw utility also lets you print detailed information of your hardware profile and hardware components to an HTML file as a superuser. Use the following command for this purpose:
$ sudo lshw -html > [filename.html]
Example:
$ sudo lshw -html > hardwareinfo.html
Output:
The above HTML file has been created at the /home/user/ folder.
The lscpu utility lists detailed CPU information like cpu and processing units from the files sysfs and /proc/cpuinfo to your screen. This is how you can use this command:
$ lscpu
Output:
The above output displays CPU architecture, number of CPUs, cores, CPU family model, threads, CPU caches and much more.
The lsblk utility displays information about all the basic storage devices of your system such as hard drive, its partitions and the flash drives connected to your system.
$ lsblk
You can use the following command to view much more detailed information about all the devices:
$ lsblk -a
Output:
The lsusb command lists information about all the USB controllers and the devices connected to them. Please run the following command:
$ lsusb
You can also use the following command to view much detailed information about each USB device.
$ lsusb -v
Output:
This output displays all the USB controllers and the attached devices.
You can also view information about the following devices of your system:
Command: $ lspci
Command: $ lsscsi
Command:
$ hdparm [devicelocation] e.g. $ hdparm /dev/sda2
After practicing along with this tutorial, you will never fail to retrieve sysinfo about Linux and the underlying hardware of your system. This will help you check the system specifications and whether or not prospective hardware or software is compatible with your system.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…