The first method :
# lsb_release-a
LSB Version:: core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32: Printing-4.0-noarch
Distributor Id:centos
Description:centos Release 5.7 (Final)
release:5.7
Codename:final
This command applies to all versions of Linux that comply with the LSB specification, including Redhat, SuSE, Debian, Ubuntu, CentOS, and other distributions.
The next command cannot view the current system name and version, but it can display system core information.
[Email protected] ~ # uname
Linux
[Email protected] ~ # Uname-r
2.6.18-164.el5
[Email protected] ~]# uname-a
Linux localhost.localdomain 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT. i686 i686 i386 Gnu/linux
The following two ways apply to Redhat,centos
[Email protected] ~ # Cat/etc/redhat-release
CentOS Release 5.7 (Final)
Log in to Linux execution Rpm-q redhat-release
#rpm-Q Redhat-release
or CentOS
[Email protected] ~ # Rpm-q Centos-release
Centos-release-5-7.el5.centos.1
The fourth method:
Commands for the current version of the CentOS version corresponding to Redhat
This command is not accurate under CentOS, and the system and version shown are also red Hat 3.4.6-10.
# cat/proc/version
Linux version 2.6.9-78.ELSMP ([email protected]) (GCC version 3.4.6 20060404 (Red Hat 3.4.6-10)) #1 SMP Fri Jul 25 00:04:2 8 EDT 2008
And this command is used on Ubuntu, the display of smart see is Ubuntu, but do not see the version.
One last method:
#cat/etc/issue
Under CentOS perform the display as:
CentOS Release 5.7 (Final)
Kernel \ r on an \m
or shown under Ubuntu as:
Ubuntu 11.04 \ \l
You can view the version number of the Ubuntu that is currently running.
"Share" Five ways to view system information such as Linux system version numbers such as Ubuntu/redhat