On Unix-like operating systems, the free command displays the total amount of free and used physical and swap memory, and the buffers used by the kernel.
This page describes the GNU/Linux version of free.
Syntax
free [options]
Options
Examples
free
Running free with no options displays a chart similar to the example below.
Syntax
Examples
Related commands
Linux commands help
total used free shared buffers cached
Mem: 1006708 935872 70836 0 148244 346656 -/+ buffers/cache: 440972 565736 Swap: 262140 130084 132056
free -ms 5
The command above displays the memory in megabytes with the “s 5” telling the system to continuously poll the data and display the results.
When using the free command, the two important lines are the -/+ buffers/cache line and Swap line. If you want to get a good idea on how much free memory is available, the free section in the buffers/cache is what you should be reading. Linux keeps the contents of memory in the buffers to help having to access the same data over-and-over from the slower disk drive. If your buffers/cache free memory is low or your swap free is low, a memory upgrade is necessary.
watch free
This command is similar to the command mentioned above and uses watch to display the current memory usage.
Related commands
ps — Report the status of a process or processes.top — Display a sortable, continually-updated list of processes.vmstat — Report statistics about virtual memory usage.