$linuxjunkies
>

free(1)

Display total, used, and free memory in the system.

UbuntuDebianFedoraArch

Synopsis

free [OPTION]

Description

The free command reports the amount of free and used memory on a Linux system, including physical RAM, swap space, and buffers/cache. It reads from /proc/meminfo and displays memory usage in a tabular format.

Memory is often not truly "free" because Linux caches disk data to improve performance. The "available" column shows memory that can be freed quickly if applications need it, making it a better indicator of usable memory than the "free" column.

Common options

FlagWhat it does
-hhuman-readable output (B, K, M, or G)
-bshow output in bytes
-kshow output in kilobytes (default)
-mshow output in megabytes
-gshow output in gigabytes
--terashow output in terabytes
-s Nrepeat display every N seconds
-c Ndisplay N times when using -s (then exit)
-wshow wide format with separate buffers and cache columns
-tdisplay total line (sum of RAM and swap)
-lshow detailed low/high memory statistics (rarely used)

Examples

Display memory usage in human-readable format (MB/GB)

free -h

Show memory usage in megabytes

free -m

Update memory display every 2 seconds (Ctrl+C to stop)

free -s 2

Display memory in human-readable format with total row

free -h -t

Show first two lines of memory in bytes (RAM only)

free -b | head -2

Continuously monitor memory with auto-refresh every 2 seconds

watch free -h

Related commands