How to check Operating System ( OS ) and Kernel Version in Linux

This article shows how we can know the operating system and name, version, and other different information related to the system.

An operating system ( OS ) is the backbone of every computer system. Operating is a part of the system software. It can be defined as a programming code that works like an interface between a user of a computer system and the hardware of the system OS. Apart from this one famous open source operating system is named Linux. It is open-source system software that manages hardware and system resources directly.

Linux has a layered architecture with two important parts, which are and system program code. The main component of the Linux OS are the kernel, Shell, Command and it’s Utility and applications

The is called the heart of the operating system. When the Operating system booted, the kernel is read into memory. It keeps in as long as the system is running. The main functions of the kernel are :

  • File Management
  • Process Management
  • Management
  • Interrupt and handling
  • Jobs Scheduling etc…

The below commands should run on Linux systems like CentOS, Ubuntu, AlmaLinux, Rocky Linux, and Debian-based operating systems.

Check the Current Linux version and Operating System Name :

In Linux

1. hostnamectl: To show system information and manage computer name

These days the latest hostnamectl command is typically used to show the Linux version . It also reflects OS Name with system information. It also manages the system hostname.

# hostnamectl

OUTPUT :

Below Output I have tested with AlmaLinux operating system .

[[email protected] ~]$ hostnamectl
Static hostname: srv1.techtransit.org
Icon name: computer-vm
Chassis: vm
Machine ID: c3f747d64c8a4c9c84a014d645c821d6
Boot ID: a257181d019843b2a3ccf4d78f9a8ca6
Virtualization: kvm
Operating System: AlmaLinux 8.5 (Arctic Sphynx)
CPE OS Name: cpe:/o:almalinux:almalinux:8::baseos
Kernel: Linux 4.18.0-348.el8.x86_64
Architecture: x86-64

The important part of hostnamectl for system administrators is that hostnamectl shows all information regarding os, kernel, and also architecture.

2. Uname Command and its usages :

The uname command lists the name of the current system.

Below is the command example.

# uname -r Gives the VERSION of Linux being used.

# uname -m Gives the architecture of the operating system.

# uname -a Prints all information corresponding to different options.

# uname -n Prints the name of the system by which it is communicating to outside the world.

3 . /proc/version File

/proc is the folder that keeps virtual system information. So it also keeps system version information.

Linux Version

4. /etc/os-release

the etc folder also has an os-release file that keeps information related to the operating system only like logo, version, privacy policy URL, etc. But it does not keep version information. Please check the below screenshot, I checked it on the fedora operating system.

# cat /etc/os-release
OS Release Version

Thanks for reading, if you like this article please share your comment. You can also check another article for AlmaLinux Installation Steps.

About Sachin Gupta

I am a professional freelance contributor and founder of tech transit. Love to write and lover of education, culture, and community. I have been using it, setting, supporting, and maintaining it since 2009.Linux rocks!

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *