zoukankan      html  css  js  c++  java
  • MySQL Hardware--CentOS 6查看CPU信息

    查看CPU信息

    cpu_model=`cat /proc/cpuinfo |grep "model name"|awk -F ':' '{print $2}' |uniq`
    cpu_mhz=`cat /proc/cpuinfo |grep "cpu MHz"|awk -F ':' '{print $2}' |uniq`
    cpu_cache_size=`cat /proc/cpuinfo |grep "cache size"|awk -F ':' '{print $2}' |uniq`
    physical_cpu_count=`cat /proc/cpuinfo| grep "physical id"| sort -u | wc -l`
    logic_cpu_count=`cat /proc/cpuinfo| grep "processor"| wc -l`
    core_count_per_cpu=`cat /proc/cpuinfo| grep "cpu cores"|awk -F ':' '{print $2}' | uniq`
    support_64_count=`cat /proc/cpuinfo | grep flags | grep ' lm '|wc -l`
    sibling_count=`cat /proc/cpuinfo |grep "sibling" |awk -F ':' '{print $2}'|uniq`
    
    if [[ $support_64_count -gt 0 ]]
    then
    is_support_64=1
    else
    is_support_64=0
    fi
    
    if [[ $sibling_count -gt $core_count_per_cpu ]]
    then
    is_supper_thread=1
    else
    is_supper_thread=0
    fi
    
    echo "当前服务器CPU信息:" > /tmp/cpu_info.txt
    echo "物理CPU数量 : ${physical_cpu_count}" >> /tmp/cpu_info.txt
    echo "逻辑CPU数量 : ${logic_cpu_count}" >>/tmp/cpu_info.txt
    echo "每CPU物理Core数 : ${core_count_per_cpu}" >>/tmp/cpu_info.txt
    echo "是否超线程 : ${is_supper_thread}" >>/tmp/cpu_info.txt
    echo "是否支持64位 : ${is_support_64}" >>/tmp/cpu_info.txt
    echo "CPU型号 : ${cpu_model}" >>/tmp/cpu_info.txt
    echo "CPU频率 : ${cpu_mhz}" >>/tmp/cpu_info.txt
    echo "CPU缓存 : ${cpu_cache_size}" >>/tmp/cpu_info.txt
    
    cat /tmp/cpu_info.txt
  • 相关阅读:
    usually study notebook
    (转)轻松掌握shell编程中数组的常见用法及示例
    (转)python学习链接
    (转)Python作业day2购物车
    (转)python 列表与元组的操作简介
    (转)总结Linux的chattr与lsattr命令详解
    mysql特殊语句学习
    PHP位操作符
    html5中script的async属性
    jquery资源
  • 原文地址:https://www.cnblogs.com/gaogao67/p/10749655.html
Copyright © 2011-2022 走看看