Hack 89. Free command examples

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

Comments on this entry are closed.

  • Sunda November 3, 2013, 2:47 am

    human readable version

    Example:
    # free -h

    total used free shared buffers cached
    Mem: 2,0G 1,8G 137M 0B 103M 252M
    -/+ buffers/cache: 1,5G 493M
    Swap: 3,7G 344M 3,4G