Free command displays all the necessary information about system physical (RAM) and swap memory.
Syntax: free [options]
What is the total RAM on my system?
In the example below, the total physical memory on this system is 1GB. The values displayed below are in KB.
# free total used free shared buffers cached Mem: 1034624 1006696 27928 0 174136 615892 -/+ buffers/cache: 216668 817956 Swap: 2031608 0 2031608
What is the total memory on my system including RAM and Swap?
In the following command:
- option m displays the values in MB
- option t displays the “Total” line, which is sum of physical and swap memory values
- option o is to hide the buffers/cache line from the above example.
# free –mto total used free shared buffers cached Mem: 1010 983 27 0 170 601 Swap: 1983 0 1983 Total: 2994 983 2011