I. Run the following command to view the kernel version:
1) [root @ sor_sys ~] # Cat/proc/version
Linux version 2.6.18-238. EL5 (mockbuild@x86-012.build.bos.redhat.com) (GCC version 4.1.2 20080704 (Red Hat 4.1.2-50) #1 SMP Sun Dec 19 14:22:44 est 2010
[Root @ sor_sys ~] #
2) [root @ sor_sys ~] # Uname-R
2.6.18-238. EL5
3) [root @ sor_sys ~] # Uname-
Linux sor_sys.99bill.com 2.6.18-238. EL5 #1 SMP Sun Dec 19 14:22:44 est 2010 x86_64 x86_64 x86_64 GNU/Linux
[Root @ sor_sys ~] #
# Uname-ax86_64 indicates that you are a 64-bit kernel and run a 64-bit system. i386. i686 indicates that you are a 32-bit kernel and a 32-bit system.
There are too many methods .. Remember one or two ..
// Xxx ××××××××××××××××××××××××××××××××××××××××××× ×××× //
II. View the Linux version:
1) log on to the server and execute lsb_release-a to list all version information, for example:
[Root @ sor_sys ~] # Lsb_release-
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 Hat Enterprise Linux as Release 4 (nahant Update 4)
Release: 4
Codename: nahantupdate4
[Root @ sor_sys ~] #
Note: This command applies to all Linux releases, including RedHat, Suse, and Debian.
2) log on to Linux and run CAT/etc/issue, for example:
[Root @ sor_sys ~] # Cat/etc/issue
Red Hat Enterprise Linux Server Release 5.6 (tikanga)
Kernel \ r on an \ m
[Root @ sor_sys ~] #
3) log on to Linux and run CAT/etc/RedHat-release, for example:
[Root @ sor_sys ~] # Cat/etc/RedHat-release
Red Hat Enterprise Linux as Release 4 (nahant Update 4)
[Root @ sor_sys ~] #
Note: In this mode, you can see the specific version number, such as as4 update 1.
4) log on to Linux and execute rpm-Q RedHat-release, for example:
[Root @ sor_sys ~] # Rpm-Q RedHat-release
Redhat-release-5Server-5.6.0.3
[Root @ sor_sys ~] #
Note: in this way, you can see a so-called release number. For example, the above example is 5.
There is a certain correspondence between the release number and the actual version, as shown below:
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
Other methods: 3rd) and 4) are only valid for Redhat Linux.
5) [root @ sor_sys ~] # File/bin/bash
/Bin/Bash: Elf 64-bit LSB executable, amd x86-64, Version 1 (sysv), for GNU/Linux 2.6.9, dynamically linked (uses SHARED libs ), for GNU/Linux 2.6.9, stripped
[Root @ sor_sys ~] #
6) [root @ sor_sys ~] # File/bin/cat
/Bin/CAT: Elf 64-bit LSB executable, amd x86-64, Version 1 (sysv), for GNU/Linux 2.6.9, dynamically linked (uses SHARED libs ), for GNU/Linux 2.6.9, stripped
[Root @ sor_sys ~] #