Linux View accurate memory capacity command

Source: Internet
Author: User

As long as Linux, through the Software warehouse (yum, apt-get, etc.) install Dmidecode, regardless of virtual machine, physical machine, execute the following command to obtain accurate memory raw capacity information.


Memory greater than 1G execution

#awk加入四舍五入的初衷是部分国产云虚机分配4G实际为3.99G, #做了四舍五入, VMware is accurate without rounding. or directly execute that command less than 1G dmidecode|grep-p-a5 "Memory Device" |grep Size | Grep-v No | awk ' {sum+=$2} END {printf "%.0fg\n", sum/1024} '


Memory is less than 1G or does not like rounding processing, want to draw the actual use of capacity, execute

Dmidecode|grep-p-a5 "Memory Device" |grep Size | Grep-v No | awk ' {sum+=$2} END {print sum ' M '} '


This article is from the "Grand Cloud Technology Record" blog, please make sure to keep this source http://xiayun.blog.51cto.com/2344243/1929466

Linux View accurate memory capacity command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.