Linux查看服务器信息

1、查看CPU信息
 

cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
#查看物理CPU个数
cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
#查看每个物理CPU中core的个数(即核数)
cat /proc/cpuinfo| grep "cpu cores"| uniq
#查看逻辑CPU的个数
cat /proc/cpuinfo| grep "processor"| wc -l

2、内存信息

#查看内存信息
dmidecode|grep -A16 'Memory Device'
#展示
Memory Device
	Array Handle: 0x001D 
	Error Information Handle: Not Provided 
	Total Width: 72 bits # 总宽度
	Data Width: 64 bits # 内存宽度
	Size: 64 GB # 内存条大小
	Form Factor: DIMM
	Set: None
	Locator: P1-DIMMA1
	Bank Locator: P0_Node0_Channel0_Dimm0
	Type: DDR4 # 内存类型
	Type Detail: Synchronous
	Speed: 2666 MT/s # M-Million百万,T-Times次数,即每秒2666百万次每秒
	Manufacturer: Samsung # 厂商信息
	Serial Number: 3262EB71 # 序列号
	Asset Tag: P1-DIMMA1_AssetTag (date:19/22)
	Part Number: M386A8K40BM2-CTD 
--
Memory Device -- 未安装
	Array Handle: 0x0025
	Error Information Handle: Not Provided
	Total Width: Unknown
	Data Width: Unknown
	Size: No Module Installed
	Form Factor: DIMM
	Set: None
	Locator: P1-DIMME1
	Bank Locator: P0_Node1_Channel1_Dimm0
	Type: Unknown
	Type Detail: Unknown
	Speed: Unknown
	Manufacturer: NO DIMM
	Serial Number: NO DIMM
	Asset Tag: NO DIMM
	Part Number: NO DIMM
--
......

Handle 0x0041, DMI type 133, 12 bytes
OEM-specific Type
	Header and Data:
		85 0C 41 00 00 00 E2 6C 00 40 00 00

Handle 0x0042, DMI type 7, 27 bytes
Cache Information

#查看内存插槽信息
dmidecode | grep -P -A5 "Memory\s+Device" | grep Size | grep -v Range

#查看内存支持最大容量
dmidecode | grep -P 'Maximum\s+Capacity'

#查看内存的频率
dmidecode | grep -A16 "Memory Device" | grep "Speed"

#查看详细的主板信息
dmidecode | grep -A16 "System Information$"

#查看详细的内存信息
dmidecode | grep -A16 "Memory Device$"

dmidecode -t memory


3、使用free命令查看内存

free命令
free -h

 free 命令显示系统内存的使用情况,包括物理内存、交换内存(swap)和内核缓冲区内存

- Mem 行显示内存的使用情况。

- Swap 行显示交换空间的使用情况。

- total 列显示系统总的可用物理内存和交换空间大小。

- used 列显示已经被使用的物理内存和交换空间。

- free 列显示还有多少物理内存和交换空间可用使用。

- shared 列显示被共享使用的物理内存大小。

- buff/cache 列显示被 buffer 和 cache 使用的物理内存大小。

- available 列显示还可以被应用程序使用的物理内存大小。

4、查看磁盘信息

df -h

sudo fdisk -l

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值