11月 192019
 

linux机器,网上下载软件时经常会看到软件包分成了32位/64位/x86/arm等不同的包,那自己的服务器适用哪个包?服务器具体的架构/位数可以通过什么命令查询呢?

 

#linux 操作系统的位数查看:

[[email protected] ~]$ getconf LONG_BIT
64

#查看cpu信息

[[email protected] ~]$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
stepping : 1
microcode : 0xb000038
cpu MHz : 2300.141
cache size : 46080 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 4600.18
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:

processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
stepping : 1
microcode : 0xb000038
cpu MHz : 2300.141
cache size : 46080 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology cpuid pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm cpuid_fault invpcid_single pti fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
bogomips : 4600.18
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual

# 总核数 = 物理CPU个数 X 每颗物理CPU的核数
# 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数
# 查看物理CPU个数
cat /proc/cpuinfo| grep “physical id”| sort| uniq| wc -l
# 查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep “cpu cores”| uniq
# 查看逻辑CPU的个数
cat /proc/cpuinfo| grep “processor”| wc -l

 

#查看cpu硬件架构

在Linux中使用命令arch可以查看机器CPU类型,如”i386”, “i486″,”i586”, “alpha”, “sparc”, “arm”, “m68k”,”mips”, “ppc”,”ia64″,”x86_64″等;ia64和x86_64就说明这台机器是64位的;

[[email protected] ~]$ arch
x86_64

或者

[[email protected] ~]$ uname -m
x86_64

uname命令可以输出一组系统信息

[[email protected] ~]$ uname -a
Linux ip-xxx.ap-southeast-1.compute.internal 4.14.146-120.181.amzn2.x86_64 #1 SMP Fri Oct 18 17:01:06 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

 

#如何查看Linux操作系统版本?不同linux版本命令稍有不同,选择可以用的
[[email protected] ~] cat /proc/version
[[email protected] ~] uname -r
[[email protected] ~] lsb_release -a
[[email protected] ~] cat /etc/issue
[[email protected] ~] cat /etc/*release*
[[email protected] ~] less /etc/redhat-release

#linux查看内存信息
[[email protected] ~] cat /proc/meminfo

Sorry, the comment form is closed at this time.