If you are logged into a CentOS Linux system, there are a few ways you can determine the version of CentOS running on the system from a command-line interface (CLI), i.e., a shell prompt.
In the /etc
directory, there should be a
/etc/centos-release
file containing information on the version
of CentOS.
$ ls -l /etc/*elease -rw-r--r-- 1 root root 27 Mar 28 2017 /etc/centos-release -rw-r--r--. 1 root root 152 Nov 25 2013 /etc/lsb-release lrwxrwxrwx 1 root root 14 Apr 20 2017 /etc/redhat-release -> centos-release lrwxrwxrwx 1 root root 14 Apr 20 2017 /etc/system-release -> centos-release $ cat /etc/*elease CentOS release 6.9 (Final) LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphi cs-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch CentOS release 6.9 (Final) CentOS release 6.9 (Final) $
To just see the version number, you can use one of the grep commands below.
$ grep -oE '[0-9]+\.[0-9]+' /etc/redhat-release 6.9 $ grep -oE '[0-9]+\.[0-9]+' /etc/centos-release 6.9 $
[ More Info ]