The free command

Display amount of free and used memory in the system 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-m, --mebi
Display the amount of memory in mebibytes.
-h, --human
Show all output fields automatically scaled to shortest three digit unit and display the units of print out.
-s, --seconds delay
Continuously display the result delay seconds apart.

Examples

free -h

Human readable (MB/GB)

free -m

In megabytes

free -s 2

Update every 2 seconds

free -m | awk '/Mem/ {print $3}'

Memory used, in MB

Lessons that use free

Related commands