码迷,mamicode.com
首页 > 系统相关 > 详细

查看linux是32位还是64位

时间:2014-08-25 19:32:05      阅读:284      评论:0      收藏:0      [点我收藏+]

标签:linux   x83-64   i686   



方法一:

        file /sbin/init 或 file /bin/ls

        结果如下

[root@localhost ~]# file /sbin/init

/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

[root@localhost ~]# file /bin/ls

/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

如果显示为32bit为32位,64bit则为64位。


方法二:

[root@localhost ~]# uname -a

Linux localhost.lw 2.6.32-358.el6.i686 #1 SMP Thu Feb 21 21:50:49 UTC 2013 i686 i686 i386 GNU/Linux

显示x86_64表示为64位,i686则为32位。


方法三:

[root@localhost ~]# getconf LONG_BIT

32

直接看显示结果

查看linux是32位还是64位

标签:linux   x83-64   i686   

原文地址:http://wizarder.blog.51cto.com/5675297/1544805

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!