linux基本信息查询
1、通过fdisk命令查看
[root@gaosheng bjdb_script]# fdisk -l Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 3394 27262273+ 83 Linux /dev/sda2 3395 3916 4192965 82 Linux swap / Solaris [root@gaosheng bjdb_script]#
2、如何查看物理内存的个数
/*
有几个Size值,就表示有几个物理内存条
*/
A机器
[root@fboccserver64 ~]# dmidecode |grep -A16 "Memory Device$" | grep Size Size: 4096 MB Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: 4096 MB Size: No Module Installed Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed [root@fboccserver64 ~]#
B机器
[root@fbccserver ~]# dmidecode |grep -A16 "Memory Device$" | grep Size Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed
C机器
[root@fbccserver ~]# dmidecode |grep -A16 "Memory Device$" | grep Size Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: 4096 MB Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed Size: No Module Installed [root@fbccserver ~]#
查看CPU大小型号和相关信息
--查看物理cpu的个数
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
--查看逻辑cpu的个数
cat /proc/cpuinfo | grep "processor" | wc -l
--物理内存查看方法
top
--查看内存信息方法
cat /proc/meminfo
--查看CPU大小型号和相关信息
dmidecode -t 4
--查看物理内存个数
/*
有几个Size值,就表示有几个物理内存条
*/
dmidecode |grep -A16 "Memory Device$" | grep Size