查看CentOS服务器的cpu、内存、操作系统版本信息

本文介绍如何使用Linux命令来检查服务器的CPU型号、物理CPU数量、内存大小及操作系统版本等信息,适用于运维人员日常监控和故障排查。

经常要查看Linux服务器的CPU、内存、操作系统版本等信息,总结一下常用的命令

1.查看CPU型号(32个逻辑CPU)

[root@nginx ~]# cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c

     32  Intel(R) Xeon(R) CPU E5-4620 v2 @ 2.60GHz


2.查看物理CPU个数(两个16核CPU)


[root@nginx ~]# cat /proc/cpuinfo | grep "physical"| sort |uniq -c

     32 address sizes: 46 bits physical, 48 bits virtual

     16 physical id: 0

     16 physical id: 1


3.查看CPU运行在多少位模式下面

[root@nginx ~]# getconf LONG_BIT

64


4.下面的结果大于0,说明支持64位操作系统


[root@nginx ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l

32


5.查看系统物理内存的大小

[root@nginx ~]# free -m

             total       used       free     shared    buffers     cached

Mem:         32051      31806        244          0         58      30654

-/+ buffers/cache:       1093      30958

Swap:        15999          0      15999


6.查看内存详细信息
[root@nginx ~]# cat /proc/cpuinfo


processor       : 0

vendor_id       : GenuineIntel

cpu family      : 6

model           : 62

model name      : Intel(R) Xeon(R) CPU E5-4620 v2 @ 2.60GHz

stepping        : 4

microcode       : 1064

cpu MHz         : 2600.065

cache size      : 20480 KB

physical id     : 0

siblings        : 16

core id         : 0

cpu cores       : 8

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 dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms

bogomips        : 5200.13

clflush size    : 64


7.查看服务器安装的是哪个发行版本

[root@nginx ~]# cat /etc/redhat-release

CentOS release 6.6 (Final)


8.查看OS的版本是64位的还是32位的

[root@nginx ~]# uname -r

2.6.32-504.el6.x86_64

[root@nginx ~]# uname -a

Linux nginx.yc.jzhnm.com 2.6.32-504.el6.x86_64 #1 SMP Wed Oct 15 04:27:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux


9.查看服务器的硬件信息


[root@nginx ~]# dmidecode |grep Vendor          #处理器厂商

Vendor: Dell Inc.

[root@nginx ~]# dmidecode |grep Product         #服务器型号

Product Name: PowerEdge R820

Product Name: 0JC2W3

本文转自    蜗牛远途   51CTO博客,原文链接:http://blog.51cto.com/ywliyq/1765787

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值