linux 几个cpu核,如何知道linux服务器CPU是多少位的, CPU有几个是几核?

1. 查看CPU是多少位?

# grep flag /proc/cpuinfo 如果发现cpu特性有lm , ia64 或者amd64营销手机,就表示这个CPU是64位的

也可以安装lshw这个rpm包或者tarball源码怎么看cpu是几核的怎么看cpu是几核的, 执行可以看到cpu的bitwise这一项, 64表示64位的cpu

2. 查看该服务器有多少个CPU, CPU是几核的?

# grep processor | wc -l 可以确定这个服务的CPU个数 * 核数

# grep physical

Understanding /proc/cpuinfo

Example:

$ uname -r

2.6.18-8.el5

How many physical processors are there?

$ grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l

2

How many virtual processors are there?

$ grep ^processor /proc/cpuinfo | wc -l

4

Are the processors dual-core (or multi-core)?

$ grep 'cpu cores' /proc/cpuinfo

cpu cores : 2

cpu cores : 2

cpu cores : 2

cpu cores : 2

"2" indicates the two physical processors are dual-core, resulting in 4 virtual processors.

If "1" was returned, the two physical processors are single-core. If the processors are single-core, and the number of virtual processors is greater than the number of physical processors, the CPUs are using hyper-threading. Hyper-threading is supported if ht is present in the CPU flags and you are using an SMP kernel.

Are the processors 64-bit?

A 64-bit processor will have lm ("long mode") in the flags section of cpuinfo. A 32-bit processor will not.

e.g.,

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm cr8legacy ts fid vid ttp tm stc

What do the CPU flags mean?

The CPU flags are briefly described in the kernel header file cpufeature.h

附: 查看操作系统是多少位?

1. 最直接的, ls / 看下/目录下是不是有/lib64这个目录

2. getconf LONG_BIT 看输出

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值