Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 1
    You don't have a machine with 32 GB RAM. You have machine with approximately 32 GB RAM. If you really want 32: echo $((32767184/1000/1000)). Commented Feb 1, 2018 at 12:39
  • 2
    Also, it's unclear what numbers are GB and what number may be GiB. Commented Feb 1, 2018 at 12:47
  • 2
    free -g outputs gibibytes, all the values quoted from output in the question are gibibytes. That’s appropriate since RAM capacities are bought in gibibyte or tebibyte increments... Commented Feb 1, 2018 at 12:53
  • 1
    Just FYI, you can get rid of the cat, grep, and echo: awk '$1 == "MemTotal:" { print $2 / 1024 / 1024 }' /proc/meminfo Commented Feb 1, 2018 at 13:20
  • 1
    For future reference on converting byte values, see unix.stackexchange.com/q/44040/85039 Commented Feb 1, 2018 at 15:52