- 10 Commands to Collect System and Hardware Info in Linux
- 1. How to View Linux System Information
- 2. How to View Linux System Hardware Information
- 3. How to View Linux CPU Information
- 4. How to Collect Linux Block Device Information
- 5. How to Print USB Controllers Information
- 6. How to Print PCI Devices Information
- 7. How to Print SCSI Devices Information
- 8. How to Print Information about SATA Devices
- 9. How to Check Linux File System Information
- 10. How to Check Linux Hardware Components Info
- Summary
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- Get Linux System and Hardware Details on the Command Line
- Displaying Basic System Information on Linux Shell
- The uname Command
- Get the Linux Kernel Name
- Get the Linux Kernel Release
- Get the Linux Kernel Version
- Get Network Node Hostname
- Get Machine Hardware Architecture (i386, x86_64, sysinfo Linux)
- Get Processor Type
- Get Hardware Platform
- Get Operating System information
- Displaying All Information of Uname Command
- Displaying Detailed Hardware Information
- Get Hardware Information with lshw
- Short Summary
- Creating an HTML File
- Get CPU Information with lscpu
- Get Block Device Information with lsblk
- Get USB Device Information with lsusb
- Get Information About Other Devices
- Karim Buzdar
- List of Commands to get Linux system info using terminal
- Commands to View Linux System info using terminal
- 1. Check Linux system CPU info and Virtualization support
- 2. Know about Linux System RAM details
- 3. Find out BIOS Info on Linux using Dmidecode
- 4. Command to view hard disk and partition distribution
- 5. Check Network card information
- 6. View PCI Slots information on Linux system
- 6. USB controllers and attached devices
- 7. Command to get complete Linux OS information
- 8. Command to get Linux Kernel Information
- 9. View Real-time processes
- 9. Complete Linux System Hardware Information
10 Commands to Collect System and Hardware Info in Linux
It is always a good practice to know the hardware components of your Linux system is running on, this helps you to deal with compatibility issues when it comes to installing packages, drivers on your system using yum, dnf, or apt.
10 Commands to Check Hardware and System Information in Linux
Therefore in these tips and tricks series, we shall look at some useful commands that can help you to extract information about your Linux system and hardware components.
1. How to View Linux System Information
To know only the system name, you can use the uname command without any switch that will print system information or the uname -s command will print the kernel name of your system.
To view your network hostname, use the ‘-n’ switch with the uname command as shown.
To get information about kernel-version, use the ‘-v’ switch.
To get the information about your kernel release, use the ‘-r’ switch.
To print your machine hardware name, use the ‘-m’ switch:
All this information can be printed at once by running the ‘uname -a’ command as shown below.
2. How to View Linux System Hardware Information
Here you can use the lshw tool to gather vast information about your hardware components such as cpu, disks, memory, usb controllers, etc.
lshw is a relatively small tool and there are few options that you can use with it while extracting information. The information provided by lshw was gathered from different /proc files.
Note: Do remember that the lshw command is executed by the superuser (root) or sudo user.
To print information about your Linux system hardware, run this command.
You can print a summary of your hardware information by using the -short option.
If you wish to generate output as an html file, you can use the option -html.
Generate Linux Hardware Information in HTML
3. How to View Linux CPU Information
To view information about your CPU, use the lscpu command as it shows information about your CPU architecture such as a number of CPUs, cores, CPU family model, CPU caches, threads, etc from sysfs and /proc/cpuinfo.
4. How to Collect Linux Block Device Information
Block devices are storage devices such as hard disks, flash drives, etc. lsblk command is used to report information about block devices as follows.
If you want to view all block devices on your system then include the -a option.
5. How to Print USB Controllers Information
The lsusb command is used to report information about USB controllers and all the devices that are connected to them.
You can use the -v option to generate detailed information about each USB device.
6. How to Print PCI Devices Information
PCI devices may include usb ports, graphics cards, network adapters, etc. The lspci tool is used to generate information concerning all PCI controllers on your system plus the devices that are connected to them.
To print information about PCI devices run the following command.
Use the -t option to produce output in a tree format.
Use the -v option to produce detailed information about each connected device.
7. How to Print SCSI Devices Information
To view all your scsi/sata devices, use the lsscsi command as follows. If you do not have the lsscsi tool installed, run the following command to install it.
After installation, run the lsscsi command as shown:
Use the -s option to show device sizes.
8. How to Print Information about SATA Devices
You can find some information about sata devices on your system as follows using the hdparm utility. In the example below, I used the block device /dev/sda1 which is the hard disk on my system.
To print information about device geometry in terms of cylinders, heads, sectors, size, and the starting offset of the device, use the -g option.
9. How to Check Linux File System Information
To gather information about file system partitions, you can use the fdisk command. Although the main functionality of the fdisk command is to modify file system partitions, it can also be used to view information about the different partitions on your file system.
You can print partition information as follows. Remember to run the command as a superuser or else you may not see any output.
10. How to Check Linux Hardware Components Info
You can also use the dmidecode utility to extract hardware information by reading data from the DMI tables.
To print information about memory, run this command as a superuser.
To print information about the system, run this command.
To print information about BIOS, run this command.
To print information about the processor, run this command.
Summary
There are many other ways you can use to obtain information about your system hardware components. Most of these commands use files in the /proc directory to extract system information.
Hope you find these tips and tricks useful and remember to post a comment in case you want to add more information to this or if you face any difficulties in using any of the commands. Remember to always stay connected to Tecmint.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
We are thankful for your never ending support.
Get Linux System and Hardware Details on the Command Line
If you are using Linux, you may need to know details about the system you are using 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. In this tutorial, you will learn how to use all of these commands to get the sysinfo Linux details.
The commands and examples in this tutorial have been tested on Ubuntu 18.04 to Ubuntu 22.04 and Debian 11.
Displaying Basic System Information on Linux Shell
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
The uname command comes with multiple switches. The basic command as described below only returns the Kernel name:
Output:
As you can see, the uname command when used without any switches only returns the kernel name i.e., Linux for my system.
Get the Linux Kernel Name
When you precisely want the command to print the kernel name, you will use the following command:
Output:
The above output has displayed Linux as my kernel name.
Get the Linux Kernel Release
In order to print the release information of your kernel, use the following command:
Output:
The above command has displayed the release number of my Linux
Get the Linux Kernel Version
In order to fetch the version of your kernel, use the following command:
Output:
The above output shows the version number of my kernel.
Get Network Node Hostname
You can use the following command to print the network hostname of your node:
You can also use the following command for the same purpose as it is more user-friendly:
Output:
Both commands will display the same output. Please note that the hostname and the node name might not be the same for non-Linux systems.
Get Machine Hardware Architecture (i386, x86_64, sysinfo Linux)
In order to know the hardware architecture of the system you are working on, please use the following command:
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.
Get Processor Type
In order to know the type of processor you are using, please use the following command:
Output:
This output shows that I am using a 64-bit processor.
Get Hardware Platform
In order to know the hardware platform you are using, please use the following command:
Output:
In my case, the output is the same as that of the machine hardware name.
Get Operating System information
The following command will let you know the name of the operating system you are using:
Output:
My Ubuntu machine has displayed the above output for my system.
Displaying All Information of Uname Command
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:
Output:
You can see that the above output shows the complete list of system information for the user.
Displaying Detailed Hardware Information
Here we will describe the commands, other than uname, that are used to extract detailed hardware information of your system:
Get Hardware Information with lshw
The lshw utility enables you to fetch important hardware information such as memory, CPU, disks, etc. from your system. Please run the following command as a super user in order to view this information:
Output:
The above output is a very detailed version of the hardware information of my system. You can also view a summary of hardware information as described in the following section.
Short Summary
In order to view the summary of your detailed hardware profile, please use the following command:
Output:
The above output is a column-wise summary of the hardware profile which is more readable.
Creating an HTML File
The lshw utility also lets you print your hardware profile to an HTML file as a superuser. Use the following command for this purpose:
Output:
The above HTML file has been created at the /home/user/ folder.
Get CPU Information with lscpu
The lscpu utility lists detailed CPU information from the files sysfs and /proc/cpuinfo to your screen. This is how you can use this command:
Output:
The above output displays CPU architecture, number of CPUs, cores, CPU family model, threads, CPU caches and much more.
Get Block Device Information with lsblk
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.
You can use the following command to view much more detailed information about all the devices:
Output:
Get USB Device Information with lsusb
The lsusb command lists information about all the USB controllers and the devices connected to them. Please run the following command:
You can also use the following command to view much detailed information about each USB device.
Output:
This output displays all the USB controllers and the attached devices.
Get Information About Other Devices
You can also view information about the following devices of your system:
- PCI devices
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.
Karim Buzdar
About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. You can reach Karim on LinkedIn
List of Commands to get Linux system info using terminal
In Linux, we can use the command terminal to check various system hardware configurations and information such as CPU, Memory, hard disk, etc., and here are those to use…
Although there are tools that can display Linux system info graphically, however, here we are going to use the inbuilt commands.
The question of how a system is equipped and how it performs in harsh everyday life is not only of theoretical interest. Lot’s of time to solve a problem we need to know hardware and its utilization to remove some bottleneck. Thus, if you are new to Linux systems or running any cloud server where you want to know about the system load, the network interface, and type of processor and chipset, or what hardware is actually in the system? Then here some top commands to follow…
Commands to View Linux System info using terminal
Here we are using Ubuntu 20.04 to display the results of the Linux system info commands, however, you can use them on older versions such as Ubuntu 18.04/16.04 including RPM-based distros like CentOS and RHEL. Apart from them, others are also supported such as Debian, Linux Mint, Kali, Elementary OS, Manjaro, and more.
1. Check Linux system CPU info and Virtualization support
To check out the full information of Linux system’s CPU such as Type of Architecture (i386, x86_64, etc.) (32-bit or 64-bit), Socket, Cores per socket, CPU speed, L cache, Virtualization type or support, etc. use the below given single command:
Furthermore, you can also check each CPU in detail (CPU model, frequency, etc.) of your computer, laptop, or server using:
Output:
2. Know about Linux System RAM details
Check out free Memory on your Linux system along with details of its size and hardware information.
To print free available RAM, type:
Those who are interested in full detail such as Total Memory, Free Memory, Buffers, Cache, Swap cached, Active, mapped, and more… can go for this one:
To identify each RAM used on each memory slot of your system’s motherboard, print the Memory Controller information using the dmidecode command:
3. Find out BIOS Info on Linux using Dmidecode
Dmidecode dumps the DMI (Desktop Management Interface) information of the machine in a readable way. This information includes hardware and BIOS.
You can get the current configuration and the maximum configuration supported by the system, such as the maximum amount of memory supported that we already have shown above…
Therefore, here are some uses of the dmidecode command to know further details of the system as well such as BIOS version, motherboard, and processor.
If you want to view all Linux useful system information use this one. However, it will give a lot of information.
4. Command to view hard disk and partition distribution
Do you want to know about each size of Hard disk and partition available? Then use-
OutPut:
Furthermore, those who want to dig more on hard disk and partitions, then to have each detail of the installed drives run fdisk -l with sudo rights:
Output
To get a clear view and all information along with the type of file system and partitions mounted points, we can also use:
Mount points can be further elaborated with:
5. Check Network card information
The network card installed on our Linux system is one of the important components to connect the internet and other local networks. However, to know its model, manufacturer, and other information without operating the system’s case, use the below-given commands.
Find out the IP address and available active ethernet interfaces:
Now, after using the above command you get the IP address and active ethernet interface, just use that with the below command. For example, ens33 is our interface.
The ethtool will show all information about the network card bandwidth such as what is the max speed, supported link modes, ports, and more…
To get network information we can also use Net-tools, however, we need to install it because by default it would not available on the system.
For Debian/Ubuntu: sudo ap tinstall net-tools
For RHEL/CentOS/Fedora– sudo yum install net-tools or sudo dnf install net-tools
To know Ipaddress:
For getting details of active connections, protocols, domain sockets, and more…
6. View PCI Slots information on Linux system
PCI slots, where we use graphic cards, network cards, and other third-party hardware directly on the Motherboard. To know about these PCI hardware slots run:
If you want more detailed information: lspci -v or lspci -vv
To see the device tree: lscpi -t
6. USB controllers and attached devices
View the details of USB slots and the devices plugged into them using lsusb command:
To have detailed info on USB slots and their active devices use :
7. Command to get complete Linux OS information
When we are running a Linux server and after upgrading or having installation, in case we want to know what version of Linux operating system we are using then, that is possible as well using the command terminal.
Get release info only:
8. Command to get Linux Kernel Information
A kernel, which is the core part of our Linux system, to check out which version we on before updating or after, run:
9. View Real-time processes
To go a bit further and know PID (Process ID, Unique number of the process) of the process executed on the system along with what is currently active we can use two commands:
To check out the PID (Process ID, Unique number of the process) of the process.
Real-time display of process status
A top is a text-based tool that gives complete information of currently active processes in real-time. To exit it, press Ctrl+C.
9. Complete Linux System Hardware Information
Here is the one final command that can give all the hardware information of your Linux system in a single shot. However, displaying all data in one place may feel clutter but if you don’t want to use multiple commands, then this one is for you.
Those who want to omit the slight unwanted information can use the same command with a short flag.
The good thing, if you want to print or save your Linux system hardware information in HTML format then that is also possible using lshw, simply run:
you will see the created file.
Now, open your browser and type or paste: file:///home/ubuntu/lshw-info.html
Closing thoughts:
So, these were some common commands we can use to find out Linux system info on CPU, Memory, OS, kernel, Network, and more. Although, these are not the only there are so many others, so keep searching this big world of Linux. If you know some commands to get a better view of the Linux system then the comment section is all yours…