linux查看centos7系统的cpu和内存信息

查看centos7系统的CPU

lscpu

在这里插入图片描述

[root@shell ~]# lscpu 
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2               ## cpu核心总数(加起来所有的核心数)
On-line CPU(s) list:   0,1              ##  每个核心的号码
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             2               ##  两颗cpu(cpu颗数)
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 158
Model name:            Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Stepping:              10
CPU MHz:               2207.462
BogoMIPS:              4416.00
Hypervisor vendor:     VMware
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              9216K
NUMA node0 CPU(s):     0,1

/proc/cpuinfo

[root@shell ~]# cat /proc/cpuinfo 
processor       : 0                          ##  第一个核心(核心和cpu颗数都是从0开始的)
vendor_id       : GenuineIntel
cpu family      : 6
model           : 158
model name      : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
stepping        : 10
microcode       : 0xb4
cpu MHz         : 2207.462
cache size      : 9216 KB
physical id     : 0                      ##  第一颗 cpu(也是从0开始)
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec
bogomips        : 4416.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

processor       : 1                      ##  第二个核心
vendor_id       : GenuineIntel
cpu family      : 6
model           : 158
model name      : Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
stepping        : 10
microcode       : 0xb4
cpu MHz         : 2207.462
cache size      : 9216 KB
physical id     : 2                        
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 22
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon nopl xtopology tsc_reliable nonstop_tsc eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch arat fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid mpx rdseed adx smap clflushopt xsaveopt xsavec
bogomips        : 4416.00
clflush size    : 64
cache_alignment : 64
address sizes   : 43 bits physical, 48 bits virtual
power management:

用grep简便查询

这里再把他改成单颗cpu和一核心

第一个查的是cpu的核心
第二个是cpu颗数
0就是1
0,1,2,3一共就是四个cpu

[root@shell ~]# grep processor /proc/cpuinfo 
processor       : 0
[root@shell ~]# grep 'physical id' /proc/cpuinfo 
physical id     : 0

查看centos7系统的内存状况

/proc/meminfo

[root@shell ~]# cat /proc/meminfo 
MemTotal:         999964 kB    #  内存总量
MemFree:          712140 kB    #  
MemAvailable:     699664 kB   # 剩余内存
Buffers:             948 kB
Cached:           105092 kB
SwapCached:            0 kB
Active:            99712 kB
Inactive:          65844 kB
Active(anon):      59916 kB
Inactive(anon):     6448 kB
Active(file):      39796 kB
Inactive(file):    59396 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097148 kB
SwapFree:        2097148 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         59560 kB
Mapped:            24320 kB
Shmem:              6848 kB
Slab:              54420 kB
SReclaimable:      18676 kB
SUnreclaim:        35744 kB
KernelStack:        3904 kB
PageTables:         3548 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     2597128 kB
Committed_AS:     273504 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      194916 kB
VmallocChunk:   34359310332 kB
HardwareCorrupted:     0 kB
AnonHugePages:      6144 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       71552 kB
DirectMap2M:      976896 kB
DirectMap1G:           0 kB

free

free -h
以人类可读形式显示大小
free -m
以MB显示显示

[root@shell ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           976M        125M        689M        6.7M        160M        679M
Swap:          2.0G          0B        2.0G

[root@shell ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            976         125         689           6         160         679
Swap:          2047           0        2047
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值