查看linux系统内核、CPU内存、系统位数的相关命令

来源:互联网 发布:质量体系优化包括哪些 编辑:程序博客网 时间:2024/05/07 21:36

以我的笔记本为例,看看相关命令。

HP-NX6120,赛扬1.5G,2根内存条(1G + 512M),操作系统Ubuntu8.04。

查看Linux版本、内核

  1. ~$ cat /etc/issue
  2. Ubuntu 8.04.3 LTS \n \l

  1. ~$ cat /proc/version
  2. Linux version 2.6.24-26-generic (buildd@vernadsky) (gcc version 4.2.4 (Ubuntu 4.2.4-1ubuntu3))#1 SMP Tue Dec 1 18:37:31 UTC 2009

  1. ~$ uname -r
  2. 2.6.24-26-generic

查看CPU

在我的赛扬CPU笔记本上:

  1. ~$ cat /proc/cpuinfo
  2. processor   : 0
  3. vendor_id   : GenuineIntel
  4. cpu family  : 6
  5. model       : 13
  6. model name  : Intel(R) Celeron(R) M processor         1.50GHz
  7. stepping    : 8
  8. cpu MHz     : 1499.869
  9. cache size  : 1024 KB
  10. fdiv_bug    : no
  11. hlt_bug     : no
  12. f00f_bug    : no
  13. coma_bug    : no
  14. fpu     : yes
  15. fpu_exception   : yes
  16. cpuid level : 2
  17. wp      : yes
  18. flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat clflush dts acpi mmx fxsr sse sse2 ss tm pbe nx up bts
  19. bogomips    : 2999.73
  20. clflush size    : 64

在一台PC服务器上(双U双核):

  1. ~$ cat /proc/cpuinfo
  2. processor   : 0
  3. vendor_id   : GenuineIntel
  4. cpu family  : 6
  5. model       : 15
  6. model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
  7. stepping    : 6
  8. cpu MHz     : 2000.070
  9. cache size  : 4096 KB
  10. physical id : 0
  11. siblings    : 2
  12. core id     : 0
  13. cpu cores   : 2
  14. fdiv_bug    : no
  15. hlt_bug     : no
  16. f00f_bug    : no
  17. coma_bug    : no
  18. fpu     : yes
  19. fpu_exception   : yes
  20. cpuid level : 10
  21. wp      : yes
  22. flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr
  23. bogomips    : 4004.56
  24.  
  25. processor   : 1
  26. vendor_id   : GenuineIntel
  27. cpu family  : 6
  28. model       : 15
  29. model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
  30. stepping    : 6
  31. cpu MHz     : 2000.070
  32. cache size  : 4096 KB
  33. physical id : 0
  34. siblings    : 2
  35. core id     : 1
  36. cpu cores   : 2
  37. fdiv_bug    : no
  38. hlt_bug     : no
  39. f00f_bug    : no
  40. coma_bug    : no
  41. fpu     : yes
  42. fpu_exception   : yes
  43. cpuid level : 10
  44. wp      : yes
  45. flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr
  46. bogomips    : 4000.02
  47.  
  48. processor   : 2
  49. vendor_id   : GenuineIntel
  50. cpu family  : 6
  51. model       : 15
  52. model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
  53. stepping    : 6
  54. cpu MHz     : 2000.070
  55. cache size  : 4096 KB
  56. physical id : 3
  57. siblings    : 2
  58. core id     : 6
  59. cpu cores   : 2
  60. fdiv_bug    : no
  61. hlt_bug     : no
  62. f00f_bug    : no
  63. coma_bug    : no
  64. fpu     : yes
  65. fpu_exception   : yes
  66. cpuid level : 10
  67. wp      : yes
  68. flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr
  69. bogomips    : 4000.08
  70.  
  71. processor   : 3
  72. vendor_id   : GenuineIntel
  73. cpu family  : 6
  74. model       : 15
  75. model name  : Intel(R) Xeon(R) CPU            5130  @ 2.00GHz
  76. stepping    : 6
  77. cpu MHz     : 2000.070
  78. cache size  : 4096 KB
  79. physical id : 3
  80. siblings    : 2
  81. core id     : 7
  82. cpu cores   : 2
  83. fdiv_bug    : no
  84. hlt_bug     : no
  85. f00f_bug    : no
  86. coma_bug    : no
  87. fpu     : yes
  88. fpu_exception   : yes
  89. cpuid level : 10
  90. wp      : yes
  91. flags       : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm pni monitor ds_cpl tm2 xtpr
  92. bogomips    : 4000.12

可以过滤一下:

  1. ~$ grep "model name" /proc/cpuinfo
  2. model name  : Intel(R) Celeron(R) M processor         1.50GHz

多U多核的环境中查看CPU物理个数:

  1. ~$ cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l

多U多核的环境中查看CPU核数:

  1. ~$ cat /proc/cpuinfo | grep "cores" | uniq

查看内存

  1. ~$ cat /proc/meminfo
  2. MemTotal:      1547292 kB
  3. MemFree:         82216 kB
  4. Buffers:         74720 kB
  5. Cached:         895940 kB
  6. SwapCached:          0 kB
  7. Active:         712544 kB
  8. Inactive:       599772 kB
  9. HighTotal:      646976 kB
  10. HighFree:         1116 kB
  11. LowTotal:       900316 kB
  12. LowFree:         81100 kB
  13. SwapTotal:      979924 kB
  14. SwapFree:       979924 kB
  15. Dirty:              84 kB
  16. Writeback:           0 kB
  17. AnonPages:      341708 kB
  18. Mapped:          83216 kB
  19. Slab:            80324 kB
  20. SReclaimable:    67092 kB
  21. SUnreclaim:      13232 kB
  22. PageTables:       2936 kB
  23. NFS_Unstable:        0 kB
  24. Bounce:              0 kB
  25. CommitLimit:   1753568 kB
  26. Committed_AS:   886988 kB
  27. VmallocTotal:   114680 kB
  28. VmallocUsed:      6852 kB
  29. VmallocChunk:   107508 kB

可以过滤一下:

  1. ~$ grep MemTotal /proc/meminfo
  2. MemTotal:      1547292 kB

查看系统位数

当前的Linux计算机,基本上就是32位或64位之分,可以通过查看long整形的位数确定,看看是32位还是64位:

  1. ~$ getconf LONG_BIT
  2. 32
原创粉丝点击