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
top
Interactive real-time view of processes and system resource usage. Refreshes on an interval and supports live sorting and filtering.
df
Reports filesystem disk-space usage. Shows total, used, and available space per mounted filesystem.
du
Estimates disk usage of files and directories. Great for hunting the source of a full filesystem.