How to find your Linux System and Hardware Details by Command-line

In this guide, we will dig deep into the commands used to fish out these system details including the software and hardware info using uname command-line tool.

-Advertisement-

Getting hardware and your Linux system software details are one of the important steps in Linux administration. In this article, we will dig deep into the commands used to fish out these system details using uname command-line tool. Additionally, we will use the lshw command to get more detailed information about hardware.

Since the commands are native to Linux, these should work on any Linux distro Terminal. Note that all the below commands are to be entered in the Linux Terminal.

Finding Software & Hardware Details

To begin with, let’s first find out the software details including Linux Kernel, Distro, and other such details. The command used to find the system information is uname. The general syntax is as follows:

1. uname command

Usage: uname [option]

-Advertisement-

We shall discuss all the options and of the uname command with sample output from our test PC. uname  –help command in your Terminal provides all the details of how the command can be used.

uname usage
uname usage

Operating System, Hostname, and Linux Kernel

-o or –operating-system option displays the Operating System.

uname -o
-Advertisement-

Sample Output:

kiran@foss-linux:~$ uname -o
GNU/Linux

-n or –nodename option displays the hostname.

Sample Output:

-Advertisement-
kiran@foss-linux:~$ uname -n
foss-linux

For finding the Linux Kernel release, use -r or –kernel-release option.

uname -r

Sample Output:

kiran@foss-linux:~$ uname -r
5.0.0-050000-generic

-v or –kernel-version option prints the kernel version.

uname -v

Sample Output:

kiran@foss-linux:~$ uname -v
#201903032031 SMP Mon Mar 4 01:33:18 UTC 2019

Processor, Machine Type, Hardware Platform

Moving to the hardware details, we still use the uname command with options as follows:

-m, –machine displays the machine hardware name

Sample Output:

kiran@foss-linux:~$ uname --machine
x86_64

-p, –processor displays the processor type

Sample Output:

kiran@foss-linux:~$ uname -p
x86_64

-i, –hardware-platform displays the hardware platform

kiran@foss-linux:~$ uname -i
x86_64

If you want all the above information in a single command, use -a or –all option as follows.

uname -a

Sample Output:

kiran@foss-linux:~$ uname -a
Linux foss-linux 5.0.0-050000-generic #201903032031 SMP Mon Mar 4 01:33:18 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Display System Software Details
Display System Software Details

Finally, in order to know the uname utility version, use –version.

uname utility version details
uname utility version details

2. lshw command

List Hardware (lshw) command is another popular command used by the system administrators to get very detailed information of the hardware specs of the machine. It does so by reading different files in the /proc directory in the Linux machine.

The lshw utility needs root access to get the information. It can report RAM configuration, Firmware version, Motherboard configuration, CPU info, cache configuration, bus speed, etc. It comes installed by default in most of the Linux distros. If the below commands don’t work, your Linux distro does have it installed. Head over to the official Github page to install the utility.

The command syntax is lshw [-format] [-options …]

The format can be any one of the following:

html output hardware tree as HTML
-xml output hardware tree as XML
-json output hardware tree as a JSON object
-short output hardware paths
-businfo output bus information

Options can be any one of the following: 

-class CLASS only show a certain class of hardware
-C CLASS same as ‘-class CLASS’
-c CLASS same as ‘-class CLASS’
-disable TEST disable a test (like pci, isapnp, cpuid, etc. )
-enable TEST enable a test (like pci, isapnp, cpuid, etc. )
-quiet don’t display the status
-sanitize  remove sensitive information like serial numbers, etc.
-numeric output numeric IDs (for PCI, USB, etc.)
-notime exclude volatile attributes (timestamps) from output

Since it needs to run as root, use sudo before the command:

Example: sudo lshw will list all the details of the machine.

lshw command usage
lshw command usage

The best part of the lshw command is how it can export the output to html format so that you can easily share with others or save it for the record.

Usage: sudo lshw -html > [filename.html]

Example: sudo lshw -html > hardware_details.html

The html file should get saved in the Home directory.

lshw exported harware details in html format
lshw exported hardware details in HTML format

Conclusion

Hope you enjoyed reading this tutorial to find your Linux machine’s software and hardware details. Uname is a simple tool that doesn’t need root access and can get basic details. For complete details, deep diggers can use the powerful lshw command with root privileges.

-Advertisement-
Kiran Kumar
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover and enjoy hands-on with new promising distros. Currently, I'm using Ubuntu as a daily driver and run several other distros such as Fedora, Solus, Manjaro, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities, especially during Winter ;). When I'm not writing for FOSSLinux, I'm seen biking and hiking on scenic trails. I hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more and spread Linux love!. If you find a time, drop me an email or feedback from the 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,639FansLike
362FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

Top 20 Git Commands with Practical Examples

If you are here reading this post, there is a high probability that you have heard or interacted with Github, and you now want to learn Git. Before we continue with showing you some of the cool Git commands, let's understand the difference between Git and GitHub.

Top 10 New Features in Linux Kernel 5.7

Linus Torvalds has announced the release of Linux Kernel 5.7 after seven weeks of development. The release announcement comes as a piece of exciting news as it brings a host of new features for the hardware manufacturers as well as the developers.

How to install CMake on Ubuntu

CMake is a cross-platform free and open-source software tool designed to build, test, and package the software. CMake uses a simple platform and compiler-independent configuration files to control the software compilation process.

How to install Lightworks on Ubuntu

Even though Linux may not get a native installer of video editing software like Adobe Premiere or Final Cut Pro, that doesn't mean there are no industry standards tools available. Lightworks is non-linear editing (NLE) video mastering app for Windows, Linux, and macOS. Installing it on Ubuntu is simple due to deb package availability.

How to install DaVinci Resolve on Fedora

Davinci Resolve is a professional application used for color correction, video editing, visual effects, and motion graphics. It is one of the extensively used software by movie industries located in Hollywood.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

Test drive a Linux distro online before you hate it

Enter DistroTest.net, a website that allows Linux users to test various distros online, without downloading the ISO or installing the distro. With DistroTest.net, you can check a distro with no muss, no fuss.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.

10 Best PDF Editors for Linux

In this article, we will take a look at 10 of the best PDF editors and tools out there in 2019 that are available for Linux platforms. The editors are going to be judged on the basis of their functionalities, portability, ease of installation, price, and convenience.

Enabling GameMode on Linux for best gaming performance

GameMode is a combination of various libraries and daemons that allows all the users to improve the gaming performance on the Linux system. Developed by games publisher Feral Interactive, it improves gaming performance by requesting a group of options that will be applied temporarily to the Linux system.