linux命令查看系统信息

  • Post author:
  • Post category:linux


机器型号

sudo dmidecode | grep -A 9 "System Information"
或sudo dmidecode |grep -A16 "System Information$"

1.CPU:

型号:

grep "model name" /proc/cpuinfo |awk -F ':' '{print $NF}'

数量:

lscpu |grep "CPU socket" |awk '{print $NF}' 或 lscpu |grep "Socket" |awk '{print $NF}'

每个CPU的核数:

lscpu |grep "Core(s) per socket" |awk '{print $NF}'

2.内存:

卡槽数量:

sudo dmidecode -t memory |grep "Number Of Devices" |awk '{print $NF}'或sudo dmidecode -t memory |grep "Associated Memory Slots" |awk '{print $NF}'

内存数量:

sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep 'Size:.*MB' |wc -l


内存型号:

内存支持类型:

sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Type:"

每个内存频率:

sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Speed:"

每个内存大小:

sudo dmidecode -t memory |grep -A16 "Memory Device$" |grep "Size:"

查看内存支持的最大内存容量

sudo dmidecode|grep -P 'Maximum\s+Capacity'

3.硬盘:

硬盘数量、大小:

sudo fdisk -l |grep "Disk /dev/sd"

硬盘型号:

sudo hdparm -i /dev/sda |grep "Model"


https://blog.csdn.net/suchto/article/details/46330235


https://blog.csdn.net/zxllynu/article/details/88171528



版权声明:本文为w869303972原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。