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 \r 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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM