# RAM usage Information

**URL:** <https://community.unix.com/t/ram-usage-information/239449>\
**Category:** Shell Programming and Scripting\
**Created:** [May 6, 2009, 10:12am UTC](https://community.unix.com/t/ram-usage-information/239449 "2009-05-06T10:12:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![warlock129](https://community.unix.com/letter_avatar/warlock129/32/5_5575768a8748004e209b776fc1b2916d.png) [@warlock129](https://community.unix.com/u/warlock129)\
**Post date:** [May 6, 2009, 10:12am UTC](https://community.unix.com/t/ram-usage-information/239449/1 "2009-05-06T10:12:31Z")

</div>

Hi i just wanted to know what is the code to display amount of RAM and also the percentage used? I know i can possibly use the vmstat code but what part indicates the RAM? Any help would be much appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![pludi](https://community.unix.com/user_avatar/community.unix.com/pludi/32/1278_2.png) [@pludi](https://community.unix.com/u/pludi)\
**Post date:** [May 6, 2009, 10:31am UTC](https://community.unix.com/t/ram-usage-information/239449/2 "2009-05-06T10:31:34Z")

</div>

On Linux:

```nohighlight
$ free -o | awk 'BEGIN{ OFS="\t"; print "", "Total", "Used", "Free", "% used", "% free" }
/^[^]/{ print $1, $2, $3, $4, $3/$2*100, $4/$2*100 }'
Mem:	512344	83580	428764	16.3133	83.6867
Swap:	1919756	0	1919756	0	100

```

Might work on others too, I'm not sure on the -o switch (without it, free also displays info about buffers)
