如何判断Linux是32位还是64位

如何判断Linux是32位还是64位

方法一:getconf LONG_BIT
在linux终端输入 getconf LONG_BIT 命令
如果是32位机器,则结果为32

 

 [root@localhost ~]# getconf LONG_BIT  #32位
    32
 [root@localhost ~]# getconf LONG_BIT  #64位
    64

 

方法二:uname -a
如果是64位机器,会输出x86_64

 

[root@localhost ~]# uname -a

 

方法三:file /sbin/init 或者 file /bin/ls
示例:32位机器
file /sbin/init

 

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

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

 

posted on 2018-07-03 14:55  djq002  阅读(176)  评论(0编辑  收藏  举报

导航