zoukankan      html  css  js  c++  java
  • Linux下查看操作系统信息、内存情况及cpu信息:cpu个数、核心数、线程数

    文章转载:http://blog.snsgou.com/post-793.html

    1、查看物理CPU的个数

    [root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l
    1

    2、查看逻辑CPU的个数

    [root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "processor"|wc -l
    4

    3、查看CPU是几核(即,核心数)

    [root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "cores"|uniq
    cpu cores    : 4

    4、查看CPU的主频

    [root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep MHz|uniq
    cpu MHz        : 2499.982

    5、当前操作系统内核信息

    [root@MysqlCluster01 ~]# uname -a
    Linux MysqlCluster01 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

    6、当前操作系统发行版信息

    [root@MysqlCluster01 ~]# cat /etc/issue
    CentOS release 6.4 (Final)
    Kernel on an m

    7、内存使用情况

    [root@MysqlCluster01 ~]# free -m
                 total       used       free     shared    buffers     cached
    Mem:          7863       2738       5125          0        141        835
    -/+ buffers/cache:       1761       6102
    Swap:         3967          0       3967

    其他命令:

    [root@MysqlCluster01 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
          4  AMD Opteron(tm) Processor 6380  

    看到有8个逻辑CPU, 也知道了CPU型号

    [root@MysqlCluster01 ~]# getconf LONG_BIT
    64

    说明当前CPU运行在64bit模式下

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

    结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit

  • 相关阅读:
    破解网站防盗链的方法
    Mysql用户设置密码和权限
    学者批教育不公阻碍穷二代向上流动 致贫者愈贫
    未来IT行业将缩减到三类职业
    RHEL6参考文档(官方的PDF文件)
    分析:低成本应用先锋 Linux系统大盘点
    提高网站排名的5大因素
    七部门查处奥数班遇尴尬 学生齐喊“出去”
    Linux步入弱冠之年
    职位 工作
  • 原文地址:https://www.cnblogs.com/wangkongming/p/3891019.html
Copyright © 2011-2022 走看看