查看linux是多少位的几位方法

 

方法/步骤

 
  1.  

    方法一:getconf LONG_BIT

    在linux终端输入getconf LONG_BIT命令

    如果是32位机器,则结果为32

    Linux代码  

    [root@localhost ~]# getconf LONG_BIT  

    32  

    如果是64位机器,则结果为64

    Linux代码  

    [root@localhost ~]# getconf LONG_BIT  

    64  

  2.  

    方法二:uname -a

    如果是64位机器,会输出x86_64

    Linux代码  

    [chenzhou@testweb01 ~]$ uname -a  

    Linux testweb01 2.6.18-308.4.1.el5 #1 SMP Tue Apr 17 17:08:00 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux  

    可以看到,uname-a执行后的结果中输出了x86_64,说明该机器是64位的,否则代表该机器是32位的

    Linux代码  

    [root@localhost ~]# uname -a  

    Linux localhost.localdomain 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:54 EDT 2009 i686 i686 i386 GNU/Linux  

  3.  

    方法三:file /sbin/init 或者 file /bin/ls

    示例:32位机器

    file /sbin/init

    Linux代码  

    [root@localhost ~]# 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  

    file /bin/ls

    Linux代码  

    [root@localhost ~]# 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  

    示例:64位机器

    file /sbin/init

    Linux代码  

    [chenzhou@testweb01 ~]$ file /sbin/init  

    /sbin/init: 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  

    file /bin/ls

    Linux代码  

    [chenzhou@testweb01 ~]$ 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-bit或者32-bit来判断该机器是64位还是32位

    END

Linux查看系统位数的更多相关文章

  1. linux查看系统版本和系统位数

    1. uname -a you will view  kernel name.network node hostname.kernel release.kernel version.machine h ...

  2. Linux 查看系统版本及位数

    1. 查看内核版本命令: 1) [root@www ~]# cat /proc/version    Linux version 2.6.9-22.ELsmp (bhcompile@crowe.dev ...

  3. linux查看系统版本和系统位数 (转)

    1. uname -ayou will view kernel name.network node hostname.kernel release.kernel version.machine har ...

  4. linux系统中查看系统位数(转载)

    查看系统多少位网上很多种说话   ### getconf WORD_BIT 错误的 这3个是对的        getconf LONG_BIT    echo $HOSTTYPE uname -a  ...

  5. Linux查看系统版本号及关机命令各种方法归纳

    shutdown -h now 立即关机halt 立即关机init 0 立即关机poweroff 立即关机shutdown -r now 重启reboot 重启logout 注销su - 命令切换身份 ...

  6. Linux查看系统状态命令

    Linux查看系统状态命令       iostat iostat 命令详细地显示了存储子系统方面的情况.你通常用iostat来监控存储子系统总体上运行状况如何,并且在用户注意到服务器运行缓慢之前提早 ...

  7. Linux 查看系统硬件信息(实例详解)

    原文链接:http://www.cnblogs.com/ggjucheng/archive/2013/01/14/2859613.html linux查看系统的硬件信息,并不像windows那么直观, ...

  8. linux查看系统的硬件信息

    linux查看系统的硬件信息,并不像windows那么直观,这里我罗列了查看系统信息的实用命令,并做了分类,实例解说. cpu lscpu命令,查看的是cpu的统计信息. blue@blue-pc:~ ...

  9. Linux查看系统中的每个进程

    Linux查看系统中的每个进程 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ps -A PID TTY TIME CMD 1 ? 00:00:01 init ...

随机推荐

  1. python函数的参数匹配

    版本:一般用python2.7.6 python3.4.3会标注 1.不可变对象(整数.字符串)通过对象引用进行传递,在函数内部不可改变. >>> def f(a): ... a=1 ...

  2. 05 - Django应用第二步

    知识点 1) 数据库的配置 涉及到INSTALL_APPS的配置等 初次创建数据的命令 2) 模型的编写 模型的创建方式, 写一个类继承自models.Model 模型的数据类型 外键 自动创建ID列 ...

  3. linux命令学习笔记(53):route命令

    Linux系统的route命令用于显示和操作IP路由表(show / manipulate the IP routing table).要实现两 个不同的子网之间的通信,需要一台连接两个网络的路由器, ...

  4. cocos2d-x CSV文件读取 (Excel生成csv文件)

    实现类 CCSVParse.h #ifndef __C_CSV_PARSE__ #define __C_CSV_PARSE__ #include "cocos2d.h" #incl ...

  5. freeMarker(十六)——FAQ

    学习笔记,选自freeMarker中文文档,译自 Email: ddekany at users.sourceforge.net 1.JSP 和 FreeMarker ? 我们比较 FreeMarke ...

  6. HDU3037Saving Beans(组合数+lucas定理)

    Problem Description Although winter is far away, squirrels have to work day and night to save beans. ...

  7. 《Javascript高级程序设计》阅读记录(一):第二、三章

    <Javascript高级程序设计>阅读记录(一) 这个系列,我会把阅读<Javascript高级程序设计>之后,感觉讲的比较深入,而且实际使用价值较大的内容记录下来,并且注释 ...

  8. BZOJ5281:[Usaco2018 Open]Talent Show

    我对二分的理解:https://www.cnblogs.com/AKMer/p/9737477.html 题目传送门:https://www.lydsy.com/JudgeOnline/problem ...

  9. MySQL读取各个my.cnf配置文件的先后顺序是:

    /etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf 其他自定义路径下的my.cnf,例如:/data/mysql/y ...

  10. Linux CentOS安装Azure Cli工具

    vim /etc/yum.repos.d/epel.repo [epel] name=epel baseurl=http://mirrors.sohu.com/fedora-epel/6/$basea ...