Linux如何查看机器的配置信息
Linux如何查看机器的配置信息
1、查看内存信息
cat /proc/meminfo [root@web ~]# cat /proc/meminfo MemTotal: 98806896 kB MemFree: 361144 kB MemAvailable: 84982828 kB Buffers: 16 kB Cached: 82564292 kB SwapCached: 344296 kB Active: 52803312 kB Inactive: 42283548 kB Active(anon): 10701468 kB Inactive(anon): 1934460 kB Active(file): 42101844 kB Inactive(file): 40349088 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 12582904 kB SwapFree: 8850104 kB Dirty: 52 kB Writeback: 0 kB AnonPages: 12189656 kB Mapped: 24380 kB Shmem: 113320 kB Slab: 2606308 kB SReclaimable: 2508600 kB SUnreclaim: 97708 kB KernelStack: 7312 kB PageTables: 35004 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 61986352 kB Committed_AS: 79488824 kB VmallocTotal: 34359738367 kB VmallocUsed: 488288 kB VmallocChunk: 34308113404 kB HardwareCorrupted: 0 kB AnonHugePages: 8826880 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 113660 kB DirectMap2M: 5101568 kB DirectMap1G: 97517568 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 2 [root@web ~]# # 查看每个物理CPU中core的个数(即核数) cat /proc/cpuinfo| grep "cpu cores"| uniq [root@web ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq cpu cores : 8 [root@web ~]# # 查看逻辑CPU的个数 cat /proc/cpuinfo| grep "processor"| wc -l [root@web ~]# cat /proc/cpuinfo| grep "processor"| wc -l 32 [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 32 Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz [root@web ~]#