First, view the kernel version command :
(1) [[email protected] ~] #cat/proc/version
Linux version 2.6.18-238.el5 ([email protected]) (GCC version 4.1.2 20080704 (Red Hat 4.1.2-50)) #1 SMP Sun 19 14:22:44 EST2010
(2) [[Email protected]~]# uname-r
2.6.18-238.el5
(3) [[Email protected]~]# uname-a
Linux sor_sys.99bill.com 2.6.18-238.el5 #1 SMP Sun Dec 14:22:44 EST2010 x86_64 x86_64 x86_64 gnu/linux
Second, view the Linux version :
1) Log in to the server to perform lsb_release-a and list all version information, for example:
[[Email protected]~]# lsb_release-a
LSB Version:core-4.0-amd64:core-4.0-ia32:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-ia32: Graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-ia32:printing-4.0-noarch
Distributor Id:redhatenterpriseas
Description:red hatenterprise Linux as Release 4 (Nahant Update 4)
Release:4
Codename:nahantupdate4
Note: This command applies to all Linux, including Redhat, SuSE, Debian, and other distributions.
2) Log in to the Linux execution Cat/etc/issue, as follows:
[[Email protected]~]# cat/etc/issue
Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel \ r on an \m
3) Log in to the Linux execution Cat/etc/redhat-release, as follows:
[Email protected]~] #cat/etc/redhat-release
Red Hat Enterprise Linux as Release 4 (Nahant Update 4)
Note: The specific version number can be seen directly in this way, such as AS4 Update 1
4) Log in to the Linux execution Rpm-qredhat-release, as follows:
[Email protected]~]# rpm-q redhat-release
redhat-release-5server-5.6.0.3
Note: A so-called release number can be seen in this way, such as the above example is 5
There is a certain correspondence between the release number and the actual version, as follows:
Redhat-release-3as-1->redhat Enterprise Linux as 3
redhat-release-3as-7.4->redhat Enterprise Linux as 3 Update 4
Redhat-release-4as-2->redhat Enterprise Linux as 4
redhat-release-4as-2.4->redhat Enterprise Linux as 4 Update 1
Redhat-release-4as-3->redhat Enterprise Linux as 4 Update 2
redhat-release-4as-4.1->redhat Enterprise Linux as 4 Update 3
redhat-release-4as-5.5->redhat Enterprise Linux as 4 Update 4
Another: 3rd), 4) Two methods are only valid for Redhat Linux
5) [[email protected]~] #file/bin/bash
/bin/bash:elf 64-bit LSB executable, AMD x86-64, version 1 (SYSV), Forgnu/linux 2.6.9, dynamically linked (uses shared Li BS), for Gnu/linux 2.6.9,stripped
6) [[email protected]~] #file/bin/cat
/bin/cat:elf 64-bit LSB executable, AMD x86-64, version 1 (SYSV), Forgnu/linux 2.6.9, dynamically linked (uses shared Lib s), for Gnu/linux 2.6.9,stripped
commands for viewing the Linux kernel version and operating system version