- 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
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- 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.
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.
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:
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-
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:
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
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…