linux如何查看cpu32位64位

2016-12-22

linux想要查看下电脑cpu是32位还是64位,那么用什么方法去查看好呢?下面由小编给你做出详细的linux查看cpu32位64位方法介绍!希望对你有帮助!

linux查看cpu32位64位方法一

1. 查看物理CPU的个数

#cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l

2. 查看逻辑CPU的个数

#cat /proc/cpuinfo |grep "processor"|wc -l

3. 查看CPU是几核

#cat /proc/cpuinfo |grep "cores"|uniq

4. 查看CPU的主频

#cat /proc/cpuinfo |grep MHz|uniq#uname -aLinux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux

(查看当前操作系统内核信息)#cat /etc/issue | grep Linux

Red Hat Enterprise Linux AS release 4 (Nahant Update 5)

(查看当前操作系统发行版信息)#cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c8Intel(R) Xeon(R) CPU E5410 @ 2.33GHz

(看到有8个逻辑CPU, 也知道了CPU型号)#cat /proc/cpuinfo | grep physical | uniq -c4physical id : 04physical id : 1

(说明实际上是两颗4核的CPU)#getconf LONG_BIT32(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)#cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l8(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

linux查看cpu32位64位方法二

t=12015&highlight=bit虽然现在新出的Intel CPU都已经支持64bit,但是有些旧机器上可能不太清楚,因为Intel CPU的型号实在繁多。

The lm flag indicates that the CPU is a 64-bit proc. Thus, all x86-64 cpus have it, and no 32 bit CPUs have it. From /usr/include/asm/cpufeature.h: #define X86_FEATURE_LM (1*32+29) /*

Long Mode (x86-64) */上面的意思是lm标志是64位处理器所特有,所有x86-64 CPU都有这个标志,任何32位CPU都没有这个标志。

例如:[user@host ~]$ cat /proc/cpuinfo

processor : 0

vendor_id : GenuineIntel

cpu family : 15model : 4model name : Intel(R) Xeon(TM) CPU 3.00GHz

stepping : 3

cpu MHz : 2992.997

cache size : 2048 KB

physical id : 0

siblings : 2

core id : 0

cpu cores : 1apicid : 0fdiv_bug : no

hlt_bug : no

f00f_bug : no

coma_bug : nofpu : yesfpu_exception : yes

更多相关阅读

最新发布的文章