如何在Linux中获取Ram信息?

We have a lot of servers. There are different type of vendors and products. Tracking them about theirs hardware is hard work. For example to get ram information by opening all cases of servers is impossible. Here comes Linux magic. Linux provides a lot of commands. We can use dmidecode like below.

我们有很多服务器。 有不同类型的供应商和产品。 跟踪他们的硬件是艰苦的工作。 例如,不可能通过打开所有服务器箱来获取ram信息。 Linux魔术来了。 Linux提供了许多命令。 我们可以像下面那样使用dmidecode

使用dmidecode获取信息 (Getting Information With dmidecode)

dmidecode is very useful command which can provide information about hardware of the system. dmidecode will list a lot of information about CPU, Memory, Mainboard, Devices, Network etc. by default without providing any option. We will use --type 17 option in order to print detailed Memory or RAM information like below.

dmidecode是非常有用的命令,可以提供有关系统硬件的信息。 默认情况下, dmidecode将列出许多有关CPU,内存,主板,设备,网络等的信息,而无需提供任何选项。 我们将使用--type 17选项来打印详细的内存或RAM信息,如下所示。

$ dmidecode --type 17
Getting Information With dmidecode
Getting Information With dmidecode
使用dmidecode获取信息

We can see that the system has 2048 MB RAM and multiple RAM slots.

我们可以看到系统具有2048 MB RAM和多个RAM插槽。

获取内存大小 (Getting Memory Size)

As we have seen that dmidecode will print a lot of information about the RAM but if we want to strictly filter the RAM size we can use grep command like below by providing Size term.

正如我们已经看到的那样, dmidecode将打印很多有关RAM的信息,但是如果我们要严格过滤RAM大小,可以通过提供Size term来使用grep命令,如下所示。

$ sudo dmidecode --type 17 | grep Size
Getting Memory Size
Getting Memory Size
获取内存大小

获取内存频率(Getting Memory Frequency)

Like RAM size we can also print the frequency of the RAM with grep command. As frequency is expressed with MHz we will provide  Speed to the grep command.

像RAM大小一样,我们也可以使用grep命令打印RAM的频率。 当频率以MHz表示时,我们将为grep命令提供Speed

$ sudo dmidecode --type 17 | grep MHz

打印RAM /内存尺寸 (Print RAM/Memory Form Factor)

Memory/RAM has physically different form factors. Currently DIMM or SODIMM is very popular. We can get this information with the following command.

内存/ RAM在物理上有不同的外形尺寸。 当前,DIMM或SODIMM非常流行。 我们可以使用以下命令获取此信息。

$ sudo dmidecode --type 17 | grep Factor
Print RAM/Memory Form Factor
Print RAM/Memory Form Factor
打印RAM /内存尺寸

如何在Linux中获取Ram信息? 信息移植 (How To Get Ram Information In Linux? Infografic)

   How To Get Ram Information In Linux? Infografic
How To Get Ram Information In Linux? Infografic
如何在Linux中获取Ram信息? 信息移植
LEARN MORE  How Many Bytes In A Megabyte (MB)?
了解更多信息兆字节(MB)中有多少个字节?

翻译自: https://www.poftut.com/get-ram-information-linux/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值