1. 查看Linux内核版本命令:
1) linux:~ # cat /proc/version
Linux version 2.6.37.1-1.2-desktop (geeko@buildhost) (gcc version 4.5.1 20101208 [gcc-4_5-branch revision 167585] (SUSE Linux) ) #1 SMP PREEMPT 2011-02-21 10:34:10 +0100
2) linux:~ # uname -a
Linux linux 2.6.37.1-1.2-desktop #1 SMP PREEMPT 2011-02-21 10:34:10 +0100 i686 i686 i386 GNU/Linux
3) linux:~ # uname -r
2.6.37.1-1.2-desktop
2. 查看Linux版本:
1) 登录到服务器执行 lsb_release -a ,即可列出所有版本信息,如:
linux-zopi:~ # lsb_release -a
LSB Version: n/a
Distributor ID: SUSE LINUX
Description: openSUSE 11.4 (i586)
Release: 11.4
Codename: Celadon
注:这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。
2) 登录到linux执行cat /etc/issue,如:
linux:~ # cat /etc/issue
Welcome to openSUSE 11.4 "Celadon" - Kernel \r (\l).
3) 登录到linux执行cat /etc/SuSE-release,如:
linux:~ # cat /etc/SuSE-release
openSUSE 11.4 (i586)
VERSION = 11.4
CODENAME = Celadon
注:在RedHat中此命令为“cat /etc/redhat-release”。
另外在Redhat Linux中还有如下查询命令:
4) 登录到linux执行rpm -q redhat-release,如:
[root@q1test01 ~]# rpm -q redhat-release
redhat-release-4AS-3
linux$ >$ uname -m
若是i386 或 i686 则是32位kernel
x86_64 则是 64位kernel
1)、getconf LONG_BIT or getconf WORD_BIT
例如:
2)、file /bin/ls
例如:
查看linux的版本: