How do I determine RHEL (Red Hat Enterprise Linux) version?

I am a new Linux sysadmin and user. I think we have five RHEL (Red Hat Enterprise Linux) Dell servers in our office. How do I determine the RHEL version? How do I find out RHEL kernel version from the ssh session created by putty.exe?

Introduction – Red Hat Enterprise Linux (RHEL) operating system created for enterprise customers. It is prevalent among business users, developers, and sysadmin due to long-term support, stability, and high-quality open-source software. This page shows how to find out the RHEL version from the command line.

How do I determine RHEL version?

To display the Red Hat Enterprise Linux version use any one of the following command/methods:

  1. To determine RHEL version, type: cat /etc/redhat-release
  2. Execute command to find RHEL version: more /etc/issue
  3. Show RHEL version using command line, rune: less /etc/os-release
  4. RHEL 7.x or above user can use the hostnamectl command to get RHEL version

Let us see all commands in details.

How to check RHEL / Redhat version

Type the following cat command:
cat /etc/redhat-release
Sample outputs:

Red Hat Enterprise Linux Server release 7.5 (Maipo)

To display the RHEL kernel version, type:
uname -r
uname -mrs

How to confirm RedHat Enterprise Linux version using hostnamectl

Simply run the following hostnamectl command:
Sample outputs:

   Static hostname: nixcraft-rhel8
         Icon name: computer-vm
           Chassis: vm
        Machine ID: 1a790a3f946c4936a2cb8dba207d19aa
           Boot ID: 58ebfde49964425ea754814b4ac54432
    Virtualization: kvm
  Operating System: Red Hat Enterprise Linux 8.0 Beta (Ootpa)
       CPE OS Name: cpe:/o:redhat:enterprise_linux:8.0:beta
            Kernel: Linux 4.18.0-32.el8.x86_64
      Architecture: x86-64

Other commands to find out RHEL version

One can use the rpm command:
rpm --query redhat-release-server
Sample outputs:


Another option is to run lsb_release command. However, you need to install a package named redhat-lsb-core using the yum command as follows
sudo yum install redhat-lsb-core
## now get RHEL version ##
lsb_release -d
lsb_release -a

LSB Version:	:core-4.1-amd64:core-4.1-noarch
Distributor ID:	RedHatEnterprise
Description:	Red Hat Enterprise Linux release 8.0 Beta (Ootpa)
Release:	8.0
Codename:	Ootpa

A sample session from my RHEL 7 server

Let us run all commands on RHEL version 7:

Finding or determine RHEL version

Finding or determining RHEL server version using command line


This page showed you various RHEL command to find out your Redhat Enterprise Linux (RHEL) version. These examples also work on community-supported distributions like CentOS and Scientific Linux and commercial forks like Oracle Linux. Fedora Linux serves as its upstream source for RHEL. Hence examples work on Fedora too.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • SW_HW Jul 13, 2017 @ 12:25

    I always used
    less /etc/system-release-cpe

  • Sanjay Chakraborty Sep 25, 2020 @ 14:56

    How to check when server was build/installed ? The anaconda-ks.cfg can be misleading, reason if build from template it will be the template build date.

  • Antoinette Nov 30, 2020 @ 8:26

    Dear admin,

    I was wondering how to check Red Hat (RHEL) version installed on EC2 and this worked perfectly. Merci.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum