經常要檢視Linux伺服器的CPU,記憶體資訊以及作業系統版本等資訊,總結一下常用的指令,以便以後查閱。
1.檢視CPU型号(8個邏輯CPU)
[[root@mail ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c
8 Intel(R) Xeon(R) CPU E5506 @ 2.13GHz
2.檢視實體CPU個數(兩個4核CPU)
[root@mail ~]# cat /proc/cpuinfo | grep "physical"| sort |uniq -c
8 address sizes : 40 bits physical, 48 bits virtual
4 physical id : 0
4 physical id : 1
3.檢視CPU運作在多少位模式下面
[root@mail ~]# getconf LONG_BIT
64
4.下面的結果大于0,說明支援64位作業系統
[root@mail ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8
5.檢視系統實體記憶體的大小
[root@mail ~]# free
total used free shared buffers cached
Mem: 8168144 7387980 780164 0 689856 4014308
-/+ buffers/cache: 2683816 5484328
Swap: 4192924 24424 4168500
6.檢視記憶體詳細資訊
[root@mail ~]# cat /proc/cpuinfo
7.檢視伺服器安裝的是哪個發行版本
[root@mail ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)
8.檢視OS的版本是64位的還是32位的
[root@mail ~]# uname -a
Linux mail 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
9.檢視伺服器的硬體資訊
[root@DB145]# dmidecode |grep Vendor 處理器廠商
Vendor: Dell Inc.
[root@DB145]# dmidecode |grep Product 伺服器型号
Product Name: PowerEdge R610
Product Name: 0RP59R
本文轉自yzy121403725 51CTO部落格,原文連結:http://blog.51cto.com/lookingdream/1859684,如需轉載請自行聯系原作者