Linux Free Command

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

free command

The free command gives information about used and unused memory usage and swap memory of a system. By default, it displays memory in kb (kilobytes).

Memory mainly consists of RAM (random access memory) and swap memory.

Swap memory is a part of hard disk drive that acts like a virtual RAM.



Linux free1

Look at the above snapshot,

Line1tells about the memory details like total RAM available in our system, used RAM, free RAM, shared RAM, buffered RAM and cached RAM.

Line2indicates used and free buffer/cache memory.

Line3indicates total, used and free swap memory.

Displaying RAM in different format

By default, free command displays RAM information in kb format. You can display it in different format as per your wish.


  1. free -b     display information in Bytes  
  2. free -m     display information in Megabytes  
  3. free -g     display information in Gigabytes

Linux free2

free options

Option Function
free -t Display total memory
free -o Disable buffer adjusted line
free -s To update RAM at regular intervals
free -l Display high and low memory size statistics
watch free Allows iterations