know linux version command code example

Example 1: check centos version

$ cat /etc/redhat-release

output : CentOS Linux release 7.4.1708 (Core)

Example 2: how to check version of linux command line

cat /etc/os-release

Example 3: linux version command

lsb_release -a

Example 4: how to know which centos version is installed

<p>On the GUI (Gnome) upper right corner click on settings and then on details </p>

By command line 

cat /etc/centos-release

This command works also changing the word centos by os (os-release)

Example 5: cat /etc/os-release

cat /etc/os-release