10 Commands to Collect System and Hardware Info in Linux
https://www.tecmint.com/commands-to-collect-system-and-hardware-information-in-linux/
10 Commands to Collect System and Hardware Info in Linux
Aaron KiliSeptember 8, 2021 CategoriesLinux Commands 38 Comments
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.
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.
Read Also: Difference Between su and sudo User in Linux
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.
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.
TagsCommandline Tools, Linux TricksPost navigationHow to Install OwnCloud on Rocky Linux and AlmaLinux16 Top Command Examples in Linux [Monitor Linux Processes]If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.
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.
Related Posts
How to Use ‘dir’ Command with Different Options and Arguments in Linux
20 Linux egrep Command Examples
Basic SSH Command Usage and Configuration in Linux
Most Commonly Used Linux Commands You Should Know
Linux rmdir Command Examples for Beginners
38 thoughts on “10 Commands to Collect System and Hardware Info in Linux”
Comment navigation
Is there a tool that can inventory serial ports and report on the supported features for each port? For example, does the port support any/all of the control lines or only transmit/receive? Does the port have specific speed limitations? etc.
Please can you advise me for utility or tools in RHEL equivalent to explorer tool (in oracle solaris) to collect whole information about system in order to analysis .
How can we get kernel component related information in linux? What are the commands?
@Smita
Consult this guide: https://www.tecmint.com/find-linux-kernel-version-distribution-name-version-number/
Where do the html output goes to? I tried the lshw >html but I can’t find it anywhere. By the way, I was curious whether running lshw>txt would work, but it didn’t lol
@Moltke,
The html file created in your current working directory, for example if you run the following command from /home/username, the output of html will be created under /home/username, that you can check with ls command.
Thank you for your answer. Yes, after posting the question it occurred to me to check the capture again and there it was; /home/username on the search bar, so I went to my home folder and found it.
Felt a little bit like a fool and wanted to delete the comment but it is not possible to do so :)…thanks again for your answer. And nice article! I’m a big fan of this site, always come to check what’s new and always find some really useful articles like this one.
By the way, if I were to do some “benchmarks” on Linux systems, what is the best way to do so? Something else than top, htop or the likes.
I’m running some VMs under virtualbox and I’m curious if it is possible to do and how. I’d like to do that to compare them all cause I’m creating a wiki with all the tests I’ve done so far for personal use and who knows, maybe even upload it onto the web!!
@Moltke
You can use: 1. glances – a top-like monitoring tool with modern features compared to top 2. smem – reports memory consumption per-process and per-user basis in Linux 3. stress-ng – impose high CPU load and run stress test 4. And there are lot’s of other tools you can find here: 20 Command Line Tools to Monitor Linux Performance
These are obviously not the only tools, but i believe using a collection of various tools/utilities can help you come up with accurate and more reliable results. Thanks.
Thanks for your answer. I’ve used glances and it is quite useful. The other ones haven’t used them yet, but I will.
On Linux system where systemd is present, it’s possible to use some command line utilities to gather information about boot time, CPU usage and more, what can I use to do this in those ones where it is not?.
Also, the mesa-utils offer the capability to run tests on graphics performance. However, this is a lot of information to process and it is much time consuming, is there such a software/tool which I can use for gathering this information altogether?
I think probably not, but if you don’t mind I’d like to post the question, is there any? In the link you provided I see collectl, and it certainly looks like the perfect tool to accomplish what I want, or at least most of it, so I’ll try it and see what’s capable of. Thanks again for taking the time to answer. :)
You can also use smartctl to check your drives, hpasmcli/hpacucli for hp servers, and ipmitool sdr list to see information about your sensors, fans, etc.
How can i check hardware in other PCs in networks that has Linux on board? I have been using 3rd party GUI computer hardware inventory from Softinventive Lab software but it`s too pricy. Any clues?
@Kerhep
I suppose you mean checking PC hardware info from a Linux machine, we have not come across any specific tools for that purpose, however, you can use network monitoring tools such as Nagios, Zabbix, Monitorix and many more. Although, they may not offer detailed hardware info from PCs.
You could use “ansible” which is great tool mainly used for automation, orchestration, which can also handy for running standalone commands, which can just use native ssh protocol to query end device and pull out complete hardware dump and show it.
This is again open source, however, there is an enterprise version called “ansible tower” for which u would need license. Ansible is belongs to Red Hat now.
@Mssm
Thanks for the clear, descriptive and above all useful feedback. I’ll surely try it out and hope every user who has faced the same issue as @Kerhap Gause will as well.
Comment navigation
Got something to say? Join the discussion.
Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.
Comment
NameEmail
Save my name, email, and website in this browser for the next time I comment.
Linux Commands and Tools
HTTP Prompt – An Interactive Command Line HTTP Client
How to Change UUID of Partition in Linux Filesystem
How to Find Out Who is Using a File in Linux
How to Use ‘fsck’ to Repair File System Errors in Linux
How to Delete HUGE (100-200GB) Files in Linux
60 Commands of Linux : A Guide from Newbies to System Administrator
Linux Server Monitoring Tools
Use Glances to Monitor Remote Linux in Web Server Mode
GoAccess (A Real-Time Apache and Nginx) Web Server Log Analyzer
MTR – A Network Diagnostic Tool for Linux
CoreFreq – A Powerful CPU Monitoring Tool for Linux Systems
Inxi – A Powerful Feature-Rich Commandline System Information Tool for Linux
ctop – Top-like Interface for Monitoring Docker Containers
Learn Linux Tricks & Tips
How to Find a Process Name Using PID Number in Linux
Rename All Files and Directory Names to Lowercase in Linux
How to View Configuration Files Without Comments in Linux
Show a Custom Message to Users Before Linux Server Shutdown
How to Split Large ‘tar’ Archive into Multiple Files of Certain Size
4 Ways to Disable Root Account in Linux
Best Linux Tools
6 Best PDF Page Cropping Tools For Linux
6 Best Email Clients for Linux Systems
7 Useful Linux Security Features and Tools for Beginners
Best PDF Editors to Edit PDF Documents in Linux
Last updated