如何判断linux是32位还是64位?

来源:互联网 发布:cf内部刷枪软件 编辑:程序博客网 时间:2024/04/29 08:42

方法一:getconf LONG_BIT
如果是32b则输出32,64b则输出64

[root@centos fation]# getconf LONG_BIT32

方法二:uname -a

执行后的结果中输出了x86_64,说明该机器是64位的,否则代表该机器是32位的

[root@centos fation]# uname -aLinux centos 2.6.32-573.el6.i686 #1 SMP Thu Jul 23 12:37:35 UTC 2015 i686 i686 i386 GNU/Linux

方法三:file /sbin/init 或者 file /bin/ls
从结果中很容易看出

[root@centos fation]# 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@centos fation]# 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
0 0
原创粉丝点击