查看cpu位数 linux,【转】linux好windows下查看CPU位数、核数、个数

32 or 64

linux下查看操作CPU的运行位数:

getconf LONG_BIT

如结果是32,表示当前CPU工作在32位模式下(即操作系统是32位的),但并不表示CPU一定是32位的(64位的也可以当32位的来用)。要查看cpu是否支持64bit,方法如下:

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

如结果大于0, 说明支持64bit处理模式。

顺便说一下,64位的CPU必须运行在64位的操作系统下,才能实现64位的运算模式。

windows下查看操作系统和CPU的位数:

运行cmd,然后在里面输入systeminfo回车,分别查看系统类型和处理器的名称。如果是X86系列的话就表示是32位的系统和CPU,如果是64系列的话就表示是64位系统和CPU。

双核,4核,...N核

linux下通过cat /proc/cpuinfo即可查每个CPU核心的参数(主频、缓存等),如:

processor       : 3vendor_id       : GenuineIntelcpu family      : 6model           : 15model name      : Intel(R) Xeon(R) CPU           X3220  @ 2.40GHzstepping        : 11cpu MHz         : 2400.267cache size      : 4096 KBphysical id     : 0siblings        : 4core id         : 3cpu cores       : 4apicid          : 3fdiv_bug        : nohlt_bug         : nof00f_bug        : nocoma_bug        : nofpu             : yesfpu_exception   : yescpuid level     : 10wp              : yesflags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lmbogomips        : 4799.50

windows下可查看“设备管理器”里的处理器,如:

2b38a2e5d639d83421809ed0d0dfa913.png

对操作系统来说,一个核心就等于一个CPU。

物理CPU

linux下可以通过dmesg|grep -i 'physical processor'查看物理CPU的个数,如:

CPU: Physical Processor ID: 0CPU: Physical Processor ID: 0CPU: Physical Processor ID: 0CPU: Physical Processor ID: 0

表示当前服务器只有一个物理CPU,4核心。

当然,dmesg里有记录每个物理CPU的详细信息。

windows下通过systeminfo、设备管理器查看到的CPU信息都是逻辑CPU(即CPU核心)信息,如:

处理器:           安装了 2 个处理器。                  [01]: x86 Family 15 Model 107 Stepping 2 AuthenticAMD ~2200 Mhz                  [02]: x86 Family 15 Model 107 Stepping 2 AuthenticAMD ~2200 Mhz

要查看物理CPU的信息,只能通过其他工具(如DELL服务器的Server Administrator),或进BIOS。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值