View the centos version.
-- Write at the beginning --
Different Versions of Linux have some minor differences;
So, you often need to check the server version number;
-- Body --
Run the following command to view the linux Server version:
# Lsb_release-
LSB Version: base-4.0-amd64: base-4.0-noarch: core-4.0-amd64: core-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
This command applies to all linux releases, including Redhat, SuSE, and Debian.
Root @ idolaoxu ~ # Uname
Linux
Root @ idolaoxu ~ # Uname-r
2.6.18-164. el5
[Root @ idolaoxu ~] # Uname-
Linux iZ94b31ttqsZ 2.6.32-431.23.3.el6.x86 _ 64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
The following two methods apply to RedHat and CentOS:
Root @ idolaoxu ~ # Cat/etc/redhat-release
CentOS release 5.4 (Final)
Log on to linux and run rpm-q redhat-release.
# Rpm-q redhat-release
Or CentOS
Root @ idolaoxu ~ # Rpm-q centos-release
Centos-release-5-4.el5.centos.1