The OS version of a Linux distribution can be determined by using the command-line interface as well as a graphical user interface. In Linux, CLI is preferred over GUI as it provides more control over the OS.
In this article, we will mostly focus on the command line methods which can be used to check the Redhat version.
The following Linux commands can be used to check Redhat version.
- uname -a
- cat /etc/os-release
- lsb_release -a
- cat /proc/version
- cat /etc/redhat-release
Red Hat Linux version
|Release||General Availability Date||redhat-release Errata Date*||Kernel Version|
|RHEL 8.5||2021-11-09||2021-11-09 RHSA-2021:4356||4.18.0-348|
|RHEL 8.4||2021-05-18||2021-05-18 RHSA-2021:1578||4.18.0-305|
|RHEL 8.3||2020-11-03||2020-11-03 RHBA-2020:4495||4.18.0-240|
Red Hat announced a six monthly minor release cadence with RHEL 8, and at the time of writing RHEL 8.5 is the most recent release. Each minor release is ultimately just a label for a specific set of packages, baselined, tested, and released at a certain time.
Check Redhat version from /etc/os-release
The best way to check Redhat version is using cat /etc/os-release command. All we need is to open the terminal and type cat /etc/os-release. It will list the Linux OS distribution name and release version information. This works on almost all Redhat system.
If we are running a very old Linux distribution then we might not be able to use any of the above commands. Use the following command to know the OS version on our old system:
$ cat /etc/os-release
NAME=”Red Hat Enterprise Linux”
PRETTY_NAME=”Red Hat Enterprise Linux 8.4 (Ootpa)”
REDHAT_BUGZILLA_PRODUCT=”Red Hat Enterprise Linux 8″
REDHAT_SUPPORT_PRODUCT=”Red Hat Enterprise Linux”
Check Redhat version with uname command
We will use uname command, which is used to print our redhat system information such as kernel version and release name, network hostname, machine hardware name, processor architecture, hardware platform and the operating system.
The command uname -a shows the version of the Linux kernel you’re using, as well as additional details.
Linux taurus-a-1.com 4.18.0-305.el8.x86_64 #1 SMP Thu Apr 29 08:54:30 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux
Check Redhat version from /proc/version
Another way to check Redhat version is using cat /proc/version.This command will list the version of the Linux kernel, the version of gcc, the Redhat version, and the time of kernel compilation.
Linux version 4.18.0-305.el8.x86_64 (email@example.com) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Thu Apr 29 08:54:30 EDT 2021
- ———- On Red Hat Linux ———-
$ cat /etc/redhat-release
- ———- On CentOS Linux ———-
$ cat /etc/centos-release
- ———- On Fedora Linux ———-
$ cat /etc/fedora-release
- ———- On Debian Linux ———-
$ cat /etc/debian_version
- ———- On Ubuntu and Linux Mint ———-
$ cat /etc/lsb-release
- ———- On Gentoo Linux ———-
$ cat /etc/gentoo-release
- ———- On SuSE Linux ———-
$ cat /etc/SuSE-release
Check Redhat version with lsb_release command
The lsb_release command is a helpful utility to find out information about our Linux installation. It displays LSB (Linux Standard Base) information about the Linux distribution.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)