zoukankan      html  css  js  c++  java
  • Linux 查看CPU,内存,硬盘 !转

    Linux 查看CPU,内存,硬盘

       本文转自:http://hi.baidu.com/mumachuntian/item/a401368dbe8a66cab07154e8

    1 查看CPU


    1.1 查看CPU个数
    # cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
    2
    **uniq命令:删除重复行;wc –l命令:统计行数**


    1.2 查看CPU核数
    # cat /proc/cpuinfo | grep "cpu cores" | uniq
    cpu cores       : 4


    1.3 查看CPU型号
    # cat /proc/cpuinfo | grep 'model name' |uniq
    model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz


    总结:该服务器有2个4核CPU,型号Intel(R) Xeon(R) CPU E5630 @ 2.53GHz


    2 查看内存


    2.1 查看内存总数
    #cat /proc/meminfo | grep MemTotal
    MemTotal:     32941268 kB  //内存32G


    2.2 查看内存条数


    本节内容引自新浪博文《Linux查看内存条数》
    查看原文:


    # dmidecode |grep -A16 "Memory Device$"
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: 2048 MB                 //1条2G内存
            Form Factor: DIMM
            Set: 1
            Locator: DIMM1
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: 667 MHz
            Manufacturer: 7F7F7F7F7F510000
            Serial Number: 0403E324
            Asset Tag: 450721
            Part Number: 72T256220HR3SA   
    --
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: 2048 MB                    //1条2G内存
            Form Factor: DIMM
            Set: 1
            Locator: DIMM2
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: 667 MHz
            Manufacturer: 7F7F7F7F7F510000
            Serial Number: 0403E324
            Asset Tag: 450721
            Part Number: 72T256220HR3SA   
    --
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: No Module Installed           //1个内存空槽
            Form Factor: DIMM
            Set: 2
            Locator: DIMM3
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: Unknown
            Manufacturer:                
            Serial Number:        
            Asset Tag:      
            Part Number:                  
    --
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: No Module Installed               //1个内存空槽
            Form Factor: DIMM
            Set: 2
            Locator: DIMM4
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: Unknown
            Manufacturer:                
            Serial Number:        
            Asset Tag:      
            Part Number:                  
    --
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: No Module Installed            //1个内存空槽
            Form Factor: DIMM
            Set: 3
            Locator: DIMM5
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: Unknown
            Manufacturer:                
            Serial Number:        
            Asset Tag:      
            Part Number:                  
    --
    Memory Device
            Array Handle: 0x1000
            Error Information Handle: Not Provided
            Total Width: 72 bits
            Data Width: 64 bits
            Size: No Module Installed        //1个内存空槽
            Form Factor: DIMM
            Set: 3
            Locator: DIMM6
            Bank Locator: Not Specified
            Type: DDR2
            Type Detail: Synchronous
            Speed: Unknown
            Manufacturer:                
            Serial Number:        
            Asset Tag:      
            Part Number:   

     

    总结:该服务器有两条2G内存 ,空余4个插槽


    3 查看硬盘


    3.1 查看硬盘大小
    # fdisk -l | grep Disk
    Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
    总结:硬盘大小146.7G,即厂商标称的160G


    4 结语


    如果您在阅读过程中有任何疑问,发现任何纰漏,哪怕一个标点符号,您都可以通过email to : yuyi20060503@163.com来提出您宝贵的问题和意见。作者将会在下一个修订版中将您录入修订名单,感谢您诚挚的阅读。

     

    Enoch

    Software Testing Engeneer

  • 相关阅读:
    一起来看看java并发中volatile关键字的神奇之处
    Springboot — 用更优雅的方式发HTTP请求:RestTemplate
    基于springboot工程浅谈整合rabbitmq怎么样防止消息发送mq不丢失和消费mq的消息防止丢失
    实用!!!!springBoot加入微信扫码支付功能,有一说一还是挺有意思的
    shiro安全框架和spring整合
    网页发布
    Git:push失败
    Git:从github拉取一个分支到本地
    博客园添加 Github 角标
    go mod download 下载失败
  • 原文地址:https://www.cnblogs.com/patf/p/3532497.html
Copyright © 2011-2022 走看看