Videos
You can use the lsb_release command on various Linux distributions:
lsb_release -i -r
This will tell you the Distribution and Version and is a little bit more accurate than accessing files that may or may not have been modified by the admin or a software package. As well as working across multiple distros.
For RHEL, you should use:
cat /etc/redhat-release
You can look at the contents of /etc/redhat-release, which will look something like this:
$ cat /etc/redhat-release
CentOS release 5.4 (Final)
The contents are different for an actual RHEL system. This technique works on all RedHat derivatives, including CentOS, Fedora, and others.
Just curious as to if there is a rhel 9 version of RHEL Server or if it died out at 7.9 and RHEL 9 is the standard now. Thank you for any help!
Try this command:
rpm -qa | grep release
for instance on my machine I get this
redhat-release-workstation-6Workstation-6.4.0.4.el6.x86_64
If "anybody" has root access to your machine to either change /etc/redhat-release or install an alternate kernel you're most probably in bigger trouble than determining the redhat version of your system.
Just use the value pointed out by /etc/redhat-release or even better in terms of portability use the output of lsb_release as this is exactly the purpose they were made for.
With "anybody" being able to do anything with your system there is no other chance at all.