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

前端 未结 13 1796
梦如初夏
梦如初夏 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:07

    If you're interested in the physical RAM, use the command dmidecode. It gives you a lot more information than just that, but depending on your use case, you might also want to know if the 8G in the system come from 2x4GB sticks or 4x2GB sticks.

提交回复
热议问题