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 (单核)

扫描二维码关注公众号,回复: 222191 查看本文章

$ 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

猜你喜欢

转载自tzhennan.iteye.com/blog/2413278