In
this small article, we are going to see different commands to check the OS
version in Linux and other details about the operating system
Here
are a few files and commands that can be used
1. Command uname:
Usage
uname -a
[oracle@localhost
~]$ uname -a
Linux
localhost.localdomain 5.15.0-8.91.4.1.el8uek.x86_64 #2 SMP Tue Mar 7 18:28:34
PST 2023 x86_64 x86_64 x86_64 GNU/Linux
[oracle@localhost
~]$
This command displays the type of os, OS release, OS version version, hardware name, and processor type
2. Command lsb_release:
[root@localhost
~]# lsb_release -a
LSB
Version: :core-4.1-amd64:core-4.1-noarch
Distributor
ID: OracleServer
Description: Oracle
Linux Server release 8.7
Release: 8.7
Codename: n/a
[root@localhost
~]#
This command would display information including the Distributor ID, Description, OS Release, and Codename.
3. File /etc/os-release
Usage: cat /etc/os-release or more /etc/os-release
This file contains almost all the details about the operating system
4. File /etc/issue:
Usage: cat /etc/issue or more /etc/issue
[root@localhost
~]# cat /etc/issue
\S
Kernel
\r on an \m
[root@localhost ~]#
This
command will give an idea about the kernel details of the operating system
Based on the requirement, you can use a command
or file.