国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

linux直接用命令查看主機cpu型號,個數,邏輯c個數,核心數

2024-08-27 23:59:51
字體:
來源:轉載
供稿:網友

有時候我們購買的新主機,想查詢一下硬件配置是不是商家說的一樣(你懂的),這時我們可以不用第三方式工具,直接用Linux命令就可以查詢到cpu型號,物理cpu個數,邏輯cpu個數,cpu核心數。

無需第三方工具,proc文件系統里面的/proc/cpuinfo提供了豐富的cpu信息,其輸出類似如下:

  1. processor       : 0 
  2. vendor_id       : AuthenticAMD 
  3. cpu family      : 16 
  4. model           : 4 
  5. model name      : Quad-Core AMD Opteron(tm) Processor 8382 
  6. stepping        : 2 
  7. microcode       : 0x1000086 
  8. cpu MHz         : 2611.977 
  9. cache size      : 512 KB 
  10. physical id     : 0 
  11. siblings        : 4 
  12. core id         : 0 
  13. cpu cores       : 4 
  14. apicid          : 4 
  15. initial apicid  : 0 
  16. fpu             : yes 
  17. fpu_exception   : yes 
  18. cpuid level     : 5 
  19. wp              : yes 
  20. 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 mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save 
  21. bogomips        : 5223.95  //Vevb.com 
  22. TLB size        : 1024 4K pages 
  23. clflush size    : 64 
  24. cache_alignment : 64 
  25. address sizes   : 48 bits physical, 48 bits virtual 
  26. power management: ts ttp tm stc 100mhzsteps hwpstate 

型號和邏輯CPU個數:

  1. $ cat /proc/cpuinfo | grep 'model name' | cut -f2 -d: | uniq -c 
  2. 32  Quad-Core AMD Opteron(tm) Processor 8382 

可以看到有32個邏輯CPU,后面是型號,物理CPU個數:

  1. $ cat /proc/cpuinfo | grep 'physical id' | uniq -d 
  2. physical id     : 0 
  3. physical id     : 1 
  4. physical id     : 2 
  5. physical id     : 3 
  6. physical id     : 4 
  7. physical id     : 5 
  8. physical id     : 6 
  9. physical id     : 7 
  10.  
  11. //或者 
  12.  
  13. $ cat /proc/cpuinfo | grep 'physical id' | uniq -d | cut -f1 -d: | uniq -c 
  14. 8 physical id 

可以看到有8顆物理CPU,每顆CPU核心數:

  1. $ cat /proc/cpuinfo | grep 'cpu cores' | uniq 
  2. cpu cores       : 4 
  3.  
  4. //或者 
  5.  
  6. $ cat /proc/cpuinfo | grep 'core id' | sort | uniq 
  7. core id         : 0 
  8. core id         : 1 
  9. core id         : 2 
  10. core id         : 3 

8*4剛好是32顆邏輯CPU,如果有超線程技術則不是簡單的相乘就可以,還要乘以每個核心的線程數,還有一個命令lscpu,可以總覽系統cpu概況:

  1. $ lscpu 
  2. Architecture:          x86_64 
  3. CPU op-mode(s):        32-bit, 64-bit 
  4. Byte Order:            Little Endian 
  5. CPU(s):                32 
  6. On-line CPU(s) list:   0-31 
  7. Thread(s) per core:    1 
  8. Core(s) per socket:    4 
  9. Socket(s):             8 
  10. NUMA node(s):          4 
  11. Vendor ID:             AuthenticAMD 
  12. CPU family:            16 
  13. Model:                 4 
  14. Stepping:              2 
  15. CPU MHz:               2611.977 
  16. BogoMIPS:              5224.55 
  17. Virtualization:        AMD-V 
  18. L1d cache:             64K 
  19. L1i cache:             64K 
  20. L2 cache:              512K 
  21. L3 cache:              6144K 
  22. NUMA node0 CPU(s):     0-3 
  23. NUMA node1 CPU(s):     4-7 
  24. NUMA node2 CPU(s):     8-11 
  25. NUMA node3 CPU(s):     12-31

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 承德县| 剑川县| 巴彦县| 松桃| 乌苏市| 淳化县| 屏东县| 西盟| 栾城县| 开鲁县| 独山县| 成安县| 藁城市| 通城县| 宁强县| 浦东新区| 邵武市| 伽师县| 纳雍县| 蒙阴县| 故城县| 翼城县| 通州市| 玉溪市| 乐亭县| 杂多县| 隆化县| 友谊县| 汝州市| 太白县| 灵川县| 南川市| 双峰县| 洛扎县| 济南市| 洛南县| 大关县| 万盛区| 黎平县| 嘉鱼县| 无棣县|