free(1)
Display total, used, and free memory in the system.
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
| Flag | What it does |
|---|---|
-h | human-readable output (B, K, M, or G) |
-b | show output in bytes |
-k | show output in kilobytes (default) |
-m | show output in megabytes |
-g | show output in gigabytes |
--tera | show output in terabytes |
-s N | repeat display every N seconds |
-c N | display N times when using -s (then exit) |
-w | show wide format with separate buffers and cache columns |
-t | display total line (sum of RAM and swap) |
-l | show detailed low/high memory statistics (rarely used) |
Examples
Display memory usage in human-readable format (MB/GB)
free -hShow memory usage in megabytes
free -mUpdate memory display every 2 seconds (Ctrl+C to stop)
free -s 2Display memory in human-readable format with total row
free -h -tShow first two lines of memory in bytes (RAM only)
free -b | head -2Continuously monitor memory with auto-refresh every 2 seconds
watch free -h