How can I find out the total physical memory (RAM) of my linux box suitable to be parsed by a shell script?

前端 未结 13 1833
梦如初夏
梦如初夏 2020-12-07 09:52

I\'m typing a shell script to find out the total physical memory in some RHEL linux boxes.

First of all I want to stress that I\'m interested in the total ph

13条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 10:10

    I know this question was asked a long time ago, but I wanted to provide another way to do this that I found useful for an issue I just worked on:

    lshw -c memory
    

    lshw

    lshw is a small tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).

提交回复
热议问题