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 operating system created for enterprise customers. It is extremely popular among business users and sysadmin due to long-term support, stability and high-quality open source software. This page shows how to find out RHEL version from the command line.

ADVERTISEMENTS

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:
hostnamectl
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:

redhat-release-server-7.5-8.el7.x86_64

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

Finding or determine RHEL version

Finding or determining RHEL server version using command line

Conclusion

This page showed you various RHEL command to find out your Redhat Enterprise Linux (RHEL) version.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig 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 VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
1 comment… add one
  • SW_HW Jul 13, 2017 @ 12:25

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

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.