The free command in Linux gives you a quick summary of RAM and swap usage. It reads from /proc/meminfo and displays the data in a single table with one command.
This guide covers how to use the free command in Linux and what each column in its output means.
The basic syntax is:
bashfree [OPTIONS]
Run free without options to see memory and swap in kibibytes (KiB). One kibibyte equals 1024 bytes — not the same as a kilobyte (KB), which is 1000 bytes. The distinction matters when reading output or comparing values from different tools.
bashfree
total used free shared buff/cache availableMem: 8075208 3204964 1310540 551232 3559704 4198340Swap: 2097148 0 2097148
The output has two data rows: one for physical RAM and one for swap.
Each column reports a specific memory measurement:
used = total - free - buffers - cache. This is why used looks high even on a lightly loaded system: buffered and cached memory counts toward the total, not just application memoryThe practical difference: a system showing 50 MB free but 3 GB available has plenty of RAM. Reacting to the free column alone leads to false alarms.
Swap row: zero in the used swap column is the normal and healthy state. When swap usage climbs, the system is moving RAM pages to disk, which degrades performance.
Human-readable format — the most practical option for daily use:
bashfree -h
This auto-selects MB or GB based on the values.
Specific units. --mega uses SI megabytes (powers of 1000); -m uses mebibytes (powers of 1024):
bashfree --mega # megabytes: 1 MB = 1000 KBfree -m # mebibytes: 1 MiB = 1024 KiB
Wide mode splits buff/cache into two separate columns for buffers and cache:
bashfree -h -w
Show column totals — adds a line combining RAM and swap:
bashfree -h -t
Live updates — refresh every N seconds until CTRL+C:
bashfree -h -s 5
Stop after a fixed number of updates with -c:
bashfree -h -s 5 -c 10
For a quick check, free -h is all you need. If available is consistently low relative to total, the system is under memory pressure and may start swapping. Use top or htop when you need per-process memory detail. Leave a comment below if you run into any issues.