查询linux版本信息 sp,查看Linux系统版本和内核信息

Linux

查看Linux系统版本信息

1. 查看内核版本

1) 方法一:登录到linux执行cat /proc/version

[[email protected]_32bit_ip12 ~]$ cat /proc/version

Linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:35 EDT 2010

2) 方法二:登录到linux执行uname -a

[[email protected]_32bit_ip12 cpp]$ uname -a

Linux CentOS5_32bit_ip12 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux

3) 方法三:登录到linux执行uname -r

[[email protected]_32bit_ip12 cpp]$ uname -r  2.6.18-194.el5

2. 查看Linux版本

1) 方法一:登录到服务器执行lsb_release -a,即可列出所有的版本信息

[[email protected]_32bit_ip12 ~]$ lsb_release -a

LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: CentOS

Description: CentOS release 5.5 (Final) Release: 5.5

Codename: Final

2) 方法二:登录到linux执行cat /etc/issue

[[email protected]_32bit_ip12 ~]$ cat /etc/issue CentOS release 5.5 (Final)  Kernel \r on an \m

3) 方法三:登录到linux执行cat /etc/redhat-release

[[email protected]_32bit_ip12 ~]$ cat /etc/redhat-release   CentOS release 5.5 (Final)

3. 查看Linux机器是32位还是64位的方法

1) 方法一:登录到的Linux执行file /sbin/init或者file /bin/ls

[[email protected]_32bit_ip12 ~]$ file /sbin/init

/sbin/init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped 如果现实32-bit,则表示为32位的操作系统

2) 方法二:登录到的Linux执行uname -a

[[email protected]_32bit_ip12 ~]$ uname -a

Linux CentOS5_32bit_ip12 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux i686表示32位机器,i686只是i386的一个子集,支持的CPU从Pentinum 2(686)开始,之前的型号都不支持。

3) 方法三:登录到的Linux执行getconf LONG_BIT

在32位机器和64位机器上运行命令 1) 32位机器

[[email protected]_32bit_ip12 ~]$ getconf LONG_BIT 32

执行以上命令后,直接输出32,表示为32位操作系统

2) 64位机器

[[email protected]_32bit_ip12 ~]$ getconf LONG_BIT 64

执行以上命令后,直接输出64,表示为64位操作系统

参考文档http://blog.csdn.net/zhuying_linux/article/details/6859286

原文:http://www.cnblogs.com/guangwei/p/3823872.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值