Linux查看系统硬件信息

本文发布时间: 2019-Mar-22
前言:下面实验的信息是我在几台配置不同服务器的测试结果,操作系统分别为Red Hat Enterprise Linux Server release 6.0 (Santiago)、Ubuntu 7.10。所以你看到我实验信息的不同时,请不要大惊小怪。而且有些命令也不是所有Linux操作系统都支持(例如在Ubuntu 7.10就不支持dmesg),下面的内容是收集整理的,如有错误或新的方法,也会不停整理、更新。一:查看CPU信息1、CPU详细信息方法1:CPU信息一般保存在proc目录下的cpuinfo文件中。如下所示。[root@DB-Server ~]# more /proc/cpuinfoprocessor : 0vendor_id : AuthenticAMDcpu family : 16model : 5model name : AMD Athlon(tm) II X3 450 Processorstepping : 3cpu MHz : 800.000cache size : 512 KBphysical id : 0siblings : 3core id : 0cpu cores : 3apicid : 0initial apicid : 0fpu : yesfpu_exception : yescpuid level : 5wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov patpse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_savebogomips : 6428.41TLB size : 1024 4K pagesclflush size : 64cache_alignment : 64address sizes : 48 bits physical, 48 bits virtualpower management: ts ttp tm stc 100mhzsteps hwpstateprocessor : 1vendor_id : AuthenticAMDcpu family : 16model : 5model name : AMD Athlon(tm) II X3 450 Processorstepping : 3cpu MHz : 800.000 --注意:AMD的CPU的频率会调整cache size : 512 KBphysical id : 0siblings : 3core id : 1cpu cores : 3apicid : 1initial apicid : 1fpu : yesfpu_exception : yescpuid level : 5wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxextfxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacysvm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_savebogomips : 6428.64TLB size : 1024 4K pagesclflush size : 64cache_alignment : 64address sizes : 48 bits physical, 48 bits virtualpower management: ts ttp tm stc 100mhzsteps hwpstateprocessor : 2vendor_id : AuthenticAMDcpu family : 16model : 5model name : AMD Athlon(tm) II X3 450 Processorstepping : 3cpu MHz : 800.000cache size : 512 KBphysical id : 0siblings : 3core id : 2cpu cores : 3apicid : 2initial apicid : 2fpu : yesfpu_exception : yescpuid level : 5wp : yesflags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxextfxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacysvm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt npt lbrv svm_lock nrip_savebogomips : 6428.63TLB size : 1024 4K pagesclflush size : 64cache_alignment : 64address sizes : 48 bits physical, 48 bits virtualpower management: ts ttp tm stc 100mhzsteps hwpstate方法2:使用dmesg命令(注意CPU应为大写)[root@m1 ~]$dmesg | grep CPUSMP: Allowing 8 CPUs, 5 hotplug CPUsNR_CPUS:4096 nr_cpumask_bits:8 nr_cpu_ids:8 nr_node_ids:1PERCPU: Embedded 31 pages/cpu @ffff880028200000 s95064 r8192 d23720 u262144CPU: Physical Processor ID: 0CPU: Processor Core ID: 0mce: CPU supports 6 MCE banksCPU0: AMD Athlon(tm) II X3 450 Processor stepping 03Brought up 3 CPUsprocessor LNXCPU:00: registered as cooling_device0processor LNXCPU:01: registered as cooling_device1processor LNXCPU:02: registered as cooling_device2方法3:使用dmidecode查看CPU信息View Code[root@DB-Server ~]# dmidecode -t processor# dmidecode 2.10SMBIOS 2.4 present.Handle 0x0004, DMI type 4, 35 bytesProcessor InformationSocket Designation: Socket M2Type: Central ProcessorFamily: AthlonManufacturer: AMDID: 53 0F 10 00 FF FB 8B 17Signature: Family 16, Model 5, Stepping 3FlagsPGE (Page global enable):FPU (Floating-point unit on-chip)VME (Virtual mode extension)DE (Debugging extension)PSE (Page size extension)TSC (Time stamp counter)MSR (Model specific registers)PAE (Physical address extension)MCE (Machine check exception)CX8 (CMPXCHG8 instruction supported)APIC (On-chip APIC hardware supported)SEP (Fast system call)MTRR (Memory type range registers)MCA (Machine check architecture)CMOV (Conditional move instruction supported)PAT (Page attribute table)PSE-36 (36-bit page size extension)CLFSH (CLFLUSH instruction supported)MMX (MMX technology supported)FXSR (Fast floating-point save and restore)SSE (Streaming SIMD extensions)SSE2 (Streaming SIMD extensions 2)HTT (Hyper-threading technology)Version: AMD Athlon(tm) II X3 450 ProcessorVoltage: 1.6 VExternal Clock: 200 MHzMax Speed: 3000 MHzCurrent Speed: 3200 MHzStatus: Populated, EnabledUpgrade: Socket 754L1 Cache Handle: 0x0008L2 Cache Handle: 0x000AL3 Cache Handle: Not ProvidedSerial Number:Asset Tag:Part Number:2、查看物理CPU个数[root@DB-Server ~]# cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l[root@DB-Server ~]# dmesg | grep CPU | grep "Physical Processor ID" | uniq | wc -l3、查看逻辑CPU个数[root@DB-Server ~]# cat /proc/cpuinfo | grep "processor" | wc -l[root@DB-Server ~]# dmesg | grep "CPU" | grep "processor" | wc -l4、查看CPU是几核的[root@DB-Server ~]# cat /proc/cpuinfo | grep "cores" | uniqcpu cores : 35、查看CPU的主频[root@DB-Server ~]# cat /proc/cpuinfo | grep MHz | uniqcpu MHz : 800.000[root@DB-Server ~]# cat /proc/cpuinfo | grep MHzcpu MHz : 800.000cpu MHz : 800.000cpu MHz : 800.0006、查看CPU型号信息[root@DB-Server ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c3 AMD Athlon(tm) II X3 450 Processor7、通过physical id 可以判断物理CPU个数[root@DB-Server ~]# cat /proc/cpuinfo | grep physical | uniq -c1 physical id : 01 address sizes : 48 bits physical, 48 bits virtual1 physical id : 01 address sizes : 48 bits physical, 48 bits virtual1 physical id : 01 address sizes : 48 bits physical, 48 bits virtual8、查看CPU是否支持64位运算[root@DB-Server ~]# cat /proc/cpuinfo | grep flags | grep 'lm' | wc -l3结果大于0,说明支持64位运算,lm指long mode 支持lm则是64bit[root@DB-Server ~]# getconf LONG_BIT64etl:/home/etl/$getconf LONG_BIT(另外一台服务器)32说明当前CPU运行在32位模式下,当不代表CPU不支持64位二、 查看内存信息


(以上内容不代表本站观点。)
---------------------------------
本网站以及域名有仲裁协议。
本網站以及域名有仲裁協議。

2024-Mar-04 02:11pm
栏目列表