Try this command:

Copyrpm -qa | grep release

for instance on my machine I get this

redhat-release-workstation-6Workstation-6.4.0.4.el6.x86_64

Answer from Tim on Stack Overflow
🌐
nixCraft
cyberciti.biz › nixcraft › howto › linux › how do i determine rhel (red hat enterprise linux) version?
How do I determine RHEL (Red Hat Enterprise Linux) version? - nixCraft
July 15, 2024 - To display the Red Hat Enterprise Linux version use any one of the following command/methods: To determine RHEL version, type: cat /etc/redhat-release
🌐
IBM
ibm.com › docs › en › oala › 1.3.7
Verifying the operating system version - IBM Documentation
May 16, 2026 - To verify that the correct version of RHEL is installed, log in as a root user and enter the following command: cat /etc/redhat-release · Copy to clipboard · Note: If your version is not supported, you must upgrade to one of the supported versions.
🌐
PhoenixNAP
phoenixnap.com › home › kb › sysadmin › how to check red hat version
How to Check Red Hat (RHEL) Version Installed
December 11, 2025 - Red Hat-based distributions store release files in the /etc directory. List the names of release files by typing the following command: ... The output shows three files: os-release, redhat-release, and system-release.
Top answer
1 of 9
274

The kernel is universally detected with uname:

$ uname -or
2.6.18-128.el5 GNU/Linux

There really isn't a cross-distribution way to determine what distribution and version you're on. There have been attempts to make this consistent, but ultimately it varies, unfortunately. LSB tools provide this information, but ironically aren't installed by default everywhere. Example on an Ubuntu 9.04 system with the lsb-release package installed:

$ lsb_release -irc
Distributor ID: Ubuntu
Release:        9.04
Codename:       jaunty

Otherwise, the closest widely-available method is checking /etc/something-release files. These exist on most of the common platforms, and on their derivatives (i.e., Red Hat and CentOS).

Here are some examples.

Ubuntu has /etc/lsb-release:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=9.04
DISTRIB_CODENAME=jaunty
DISTRIB_DESCRIPTION="Ubuntu 9.04"

But Debian has /etc/debian_version:

$ cat /etc/debian_version
5.0.2

Fedora, Red Hat and CentOS have:

Fedora: $ cat /etc/fedora-release
Fedora release 10 (Cambridge)

Red Hat/older CentOS: $ cat /etc/redhat-release
CentOS release 5.3 (Final)

newer CentOS: $ cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)

Gentoo:

$ cat /etc/gentoo-release
Gentoo Base System release 1.12.11.1

I don't have a SUSE system available at the moment, but I believe it is /etc/SuSE-release.

Slackware has /etc/slackware-release and/or /etc/slackware-version.

Mandriva has /etc/mandriva-release.

For most of the popular distributions then,

$ cat /etc/*{release,version}

will most often work. Stripped down and barebones "server" installations might not have the 'release' package for the distribution installed.

Additionally, two 3rd party programs you can use to automatically get this information are Ohai and Facter.

Note that many distributions have this kind of information in /etc/issue or /etc/motd, but some security policies and best practices indicate that these files should contain access notification banners.

Related: How to find out version of software package installed on the node?, puppet.

2 of 9
45

You could also try:

$ cat /etc/issue

It usually (not always, though) will tell you what distribution you are using. /etc/issue is the file used for the login screen.

🌐
Red Hat
access.redhat.com › articles › 11258
How do I apply package updates to my RHEL system? - Red Hat Customer Portal
January 17, 2026 - How to apply package updates to systems running RHEL version 5, 6, 7, 8, and 9
Find elsewhere
🌐
Hewlett Packard Enterprise
community.hpe.com › t5 › operating-system-linux › how-to-check-and-confirm-the-redhat-linux-version › td-p › 4246275
How to check and confirm the RedHat Linux version - Hewlett Packard Enterprise Community
August 5, 2008 - Hi, I want to confirm the redhat linux version of our server. I have checked the below three options. 1) cat /etc/redhat-release shows the RHEL( Red hat Linux Enterprise Linux) version Ex: RHEL 4(Nahant Update 6), RHEL 3(Taroon Update 6) 2) cat /proc/version shows the 'Red Hat Linux' version.
🌐
Red Hat
access.redhat.com › solutions › 58690
How to check kernel version installed in the system - Red Hat Customer Portal
August 7, 2024 - How come I have RHEL 5.6 installed on the system [root@station ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 5.6 (Tikanga) [root@station ~]# uname -a Linux station 2.6.18-92.1.22.el5 #1 SMP Fri Dec 5 09:28:22 EST 2008 x86_64 ...
🌐
Wikipedia
en.wikipedia.org › wiki › Red_Hat_Enterprise_Linux
Red Hat Enterprise Linux - Wikipedia
4 weeks ago - Prior to June 2023, Red Hat published a sub-set of Red Hat Enterprise Linux's source code to the public in the form of modified build artifacts. Today, the complete source code for the major-version branch is available in the form of the CentOS Stream repositories.
🌐
Linux Journal
linuxjournal.com › content › what-version-rhel-am-i-using
What Version of RHEL am I Using? | Linux Journal
To get more information, you can use the following commands. $ cat /etc/system-release $ cat /etc/os-release #contains more information · To check your Red Hat version, check within the /etc/issue file.
🌐
Red Hat
access.redhat.com › solutions › 6937781
How to Determine what version of RHEL was used in the build of RHEL CoreOS - Red Hat Customer Portal
How to determine the version of Red Hat Enterprise Linux used to build Red Hat Enterprise Linux CoreOS for a specific version of OpenShift. How to determine the contents of a specific version of Red Hat Enterprise Linux Core OS.
🌐
Red Hat
redhat.com › en › technologies › linux-platforms › enterprise-linux-10
Red Hat Enterprise Linux 10
With the Red Hat Enterprise Linux command line assistant, you can ask questions and receive AI-powered guidance directly from the terminal, helping you simplify complex tasks and boost efficiency.
🌐
nixCraft
cyberciti.biz › nixcraft › howto › bash shell › linux command: show linux version
Linux Command: Show Linux Version - nixCraft
April 13, 2024 - For example: $ cat /proc/sys/kernel/{ostype,osrelease,version} Sample outputs: Linux 3.2.0-0.bpo.1-amd64 #1 SMP Sat Feb 11 08:41:32 UTC 2012 · Type the following command: $ cat /etc/*release OR $ lsb_release -a Sample outputs:
🌐
Red Hat
redhat.com › en › technologies › linux-platforms › enterprise-linux
Red Hat Enterprise Linux
Your subscription gives you access to all supported versions—including the latest release—and our extensive partner ecosystem.
🌐
Hack The Forum
hacktheforum.com › rhel-os › how-to-see-the-os-version-in-rhel
How to see the OS Version in RHEL ?
March 4, 2023 - To verify that the correct version of RHEL, is installed, log in as a root user and enter the following command: cat /etc/redhat-release To ve...
🌐
Red Hat
redhat.com › en › blog › install-linux-rhel-9
How to install RHEL 9
November 24, 2025 - To get an authentic copy of RHEL 9, create a developer account with developers.redhat.com.
🌐
Google
aboutchromebooks.com › how-to-check-rhel-version-in-linux
How To Check RHEL Version in Linux
January 14, 2026 - Use rpm -q redhat-release to see the installed package name. The command returns something like “redhat-release-8.4-1.el8”. This shows both the version number and the specific package build.