如何知道linux服务器CPU是多少位的, CPU有几个是几核?
1.查看CPU是多少位?
#grepflag/proc/cpuinfo如果发现cpu特性有lm,ia64或者amd64,就表示这个CPU是64位的
也可以安装lshw这个rpm包或者tarball源码,执行可以看到cpu的bitwise这一项,64表示64位的cpu
2.查看该服务器有多少个CPU,CPU是几核的?
#grepprocessor|wc-l可以确定这个服务的CPU个数*核数
#grepphysical
Understanding/proc/cpuinfo
Example:
$uname-r
2.6.18-8.el5
Howmanyphysicalprocessorsarethere?
$grep'physicalid'/proc/cpuinfo|sort|uniq|wc-l
2
Howmanyvirtualprocessorsarethere?
$grep^processor/proc/cpuinfo|wc-l
4
Aretheprocessorsdual-core(ormulti-core)?
$grep'cpucores'/proc/cpuinfo
cpucores:2
cpucores:2
cpucores:2
cpucores:2
"2"indicatesthetwophysicalprocessorsaredual-core,resultingin4virtualprocessors.
If"1"wasreturned,thetwophysicalprocessorsaresingle-core.Iftheprocessorsaresingle-core,andthenumberofvirtualprocessorsisgreaterthanthenumberofphysicalprocessors,theCPUsareusinghyper-threading.Hyper-threadingissupportedifhtispresentintheCPUflagsandyouareusinganSMPkernel.
Aretheprocessors64-bit?
A64-bitprocessorwillhavelm("longmode")intheflagssectionofcpuinfo.A32-bitprocessorwillnot.
e.g.,
flags:fpuvmedepsetscmsrpaemcecx8apicmtrrpgemcacmovpatpse36clflushmmxfxsrssesse2htsyscallnxmmxextfxsr_optlm3dnowext3dnowpnicx16lahf_lmcmp_legacysvmcr8legacytsfidvidttptmstc
WhatdotheCPUflagsmean?
TheCPUflagsarebrieflydescribedinthekernelheaderfilecpufeature.h
附:查看操作系统是多少位?
1.最直接的,ls/看下/目录下是不是有/lib64这个目录
2.getconfLONG_BIT看输出