16.2.1. Using the free Command
The free
command allows you to display the amount of free and used memory on the system. To do so, type the following at a shell prompt:
free
The free
command provides information about both the physical memory (Mem
) and swap space (Swap
). It displays the total amount of memory (total
), as well as the amount of memory that is in use (used
), free (free
), shared (shared
), in kernel buffers (buffers
), and cached (cached
). For example:
~]$ free
total used free shared buffers cached
Mem: 761956 607500 154456 0 37404 156176
-/+ buffers/cache: 413920 348036
Swap: 1540092 84408 1455684
By default, free
displays the values in kilobytes. To display the values in megabytes, supply the -m
command line option:
free
-m
For instance:
~]$ free -m
total used free shared buffers cached
Mem: 744 593 150 0 36 152
-/+ buffers/cache: 404 339
Swap: 1503 82 1421
For a complete list of available command line options, refer to the free(1) manual page.