linux查看内核及cpu核数等信息

1. 查看CPU型号

$ cat /proc/cpuinfo | grep name | sort | uniq

model name: Intel(R) Xeon(R) CPU E5-2630 0 @ 2.30GHz

 

2. 查看物理CPU数目

$ cat /proc/cpuinfo | grep "physical id"

8 (8个物理CPU)

 

3. 查看CPU核数和线程数

$ cat /proc/cpuinfo | grep "core id" | sort | uniq | wc -l

1 (单核)

$ cat /proc/cpuinfo | grep "processor" | sort | uniq | wc -l

8 (8线程)

 

4. 可以使用lscpu直接查看

$ lscpu

Architecture:          x86_64

CPU op-mode(s):        32-bit, 64-bit

Byte Order:            Little Endian

CPU(s):                8

On-line CPU(s) list:   0-7

Thread(s) per core:    1

Core(s) per socket:    1

Socket(s):             8

NUMA node(s):          1

Vendor ID:             GenuineIntel

CPU family:            6

Model:                 45

Stepping:              7

CPU MHz:               2299.906

BogoMIPS:              4599.70

Hypervisor vendor:     Xen

Virtualization type:   full

L1d cache:             32K

L1i cache:             32K

L2 cache:              256K

L3 cache:              15360K

NUMA node0 CPU(s):     0-7

 

5、lsb_release -a 查看linux系统版本

$ yum install -y redhat-lsb

$ lsb_release -a

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch

Distributor ID: CentOS

Description:    CentOS release 6.5 (Final)

Release:        6.5

Codename:       Final

6、uname -a 查看内核版本

$ uname -a

Linux web02 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

 

7、查看内存

$ free -g (或者:cat /proc/meminfo)

                total       used       free     shared    buffers     cached

Mem:            15          5         10          0          0          1

-/+ buffers/cache:          3         11

Swap:            1          0          1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值