欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Linux 下如何查看系统是32位 还是64 位的方法 有大用 有大大用 有大大大用

shiping1 的头像
分类: Linux2011-03-22 10:46 15151人阅读 评论(1) 收藏 举报
 
 
1. 从系统查看
1.1 uname -a 命令
[root@qs-dmm-rh2 ~]# uname -a
Linux qs-dmm-rh2 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux
  #这个是32位
[root@qs-xezf-db2 ~]# uname -a
Linux qs-xezf-db2 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
   #这个是64位
 
1.2 file /bin/ls 命令
[root@qs-dmm-rh2 ~]# file /bin/ls
/bin/ls: 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位
[root@qs-xezf-db2 ~]# file /bin/ls
/bin/ls: 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
 
  #这个是64位
1.3 getconf LONG_BIT 命令
[root@qs-dmm-rh2 ~]# getconf LONG_BIT
32
 
[root@qs-xezf-db2 ~]# getconf LONG_BIT
64
 
1.4 arch命令
[root@qs-dmm-rh2 ~]# arch
i686
 #这个是32位
[root@qs-xezf-db2 ~]# arch
x86_64
 #这个是64位
 
 
 
 
2. 从CPU查看
[root@qs-dmm-rh2 ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
0
  #这个是32位
[root@qs-xezf-db2 ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8
  #这个是64位
结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit。
 
 
有关CPU 的信息,查看我的Blog:
       Linux CPU 信息查看
       http://blog.csdn.net/tianlesoftware/archive/2010/10/27/5970500.aspx

来自 http://blog.csdn.net/tianlesoftware/article/details/6267115
http://hi.baidu.com/tjbaso/item/8bdc6c33710c7322b2c0c5b6
普通分类: