Linux如何查看机器的配置信息
1、查看内存信息
cat /proc/meminfo
[root@web ~]# cat /proc/meminfo
MemTotal: kB
MemFree: kB
MemAvailable: kB
Buffers: kB
Cached: kB
SwapCached: kB
Active: kB
Inactive: kB
Active(anon): kB
Inactive(anon): kB
Active(file): kB
Inactive(file): kB
Unevictable: kB
Mlocked: kB
SwapTotal: kB
SwapFree: kB
Dirty: kB
Writeback: kB
AnonPages: kB
Mapped: kB
Shmem: kB
Slab: kB
SReclaimable: kB
SUnreclaim: kB
KernelStack: kB
PageTables: kB
NFS_Unstable: kB
Bounce: kB
WritebackTmp: kB
CommitLimit: kB
Committed_AS: kB
VmallocTotal: kB
VmallocUsed: kB
VmallocChunk: kB
HardwareCorrupted: kB
AnonHugePages: kB
HugePages_Total:
HugePages_Free:
HugePages_Rsvd:
HugePages_Surp:
Hugepagesize: kB
DirectMap4k: kB
DirectMap2M: kB
DirectMap1G: kB
[root@web ~]#
二、核心数计算说明
# 总核数 = 物理CPU个数 X 每颗物理CPU的核数
# 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数
# 查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
[root@web ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l [root@web ~]# # 查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
[root@web ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores :
[root@web ~]# # 查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"| wc -l
[root@web ~]# cat /proc/cpuinfo| grep "processor"| wc -l [root@web ~]#
三、查看CPU信息(型号)
# 查看CPU信息(型号)
cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
[root@web ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
Intel(R) Xeon(R) CPU E5- @ .70GHz
[root@web ~]#