system

free

Displays free and used memory including RAM and swap. Reads from /proc/meminfo and summarizes at a glance.

free [OPTION]

Common flags

Flag Purpose
-h Human-readable sizes with auto units
-m Show values in MiB
-g Show values in GiB
-s Repeat output every N seconds
-c Repeat output N times (use with -s)
-t Add a total (RAM + swap) row

Examples

free -h

Human-readable memory snapshot

free -m -s 2 -c 5

Sample memory in MiB every 2s, five times

free -ht

Human-readable with a total row

free -g

Report in GiB for large-memory hosts

Gotcha

The 'available' column is what matters for headroom -- 'free' looks alarmingly low because Linux uses spare RAM for cache.

Related commands

← All Linux commands · Linux cheat sheet