free Command
Beginner System Information man(1)Display amount of free and used memory
👁 13 views
📅 Updated: Mar 15, 2026
SYNTAX
free [OPTION]...
What Does free Do?
free displays the amount of free and used memory (RAM) and swap in the system. It shows total, used, free, shared, buffer/cache, and available memory.
The "available" column is the most useful — it shows how much memory is actually available for new applications, accounting for reclaimable cache. "Free" alone is misleading because Linux uses unused RAM for disk caching.
free is essential for monitoring memory usage, diagnosing out-of-memory conditions, and capacity planning.
The "available" column is the most useful — it shows how much memory is actually available for new applications, accounting for reclaimable cache. "Free" alone is misleading because Linux uses unused RAM for disk caching.
free is essential for monitoring memory usage, diagnosing out-of-memory conditions, and capacity planning.
Options & Flags
| Option | Description | Example |
|---|---|---|
| -h | Human-readable (KB, MB, GB) | free -h |
| -m | Show in megabytes | free -m |
| -g | Show in gigabytes | free -g |
| -s N | Update every N seconds | free -h -s 5 |
| -t | Show total row | free -ht |
| -w | Wide output (separate buffers and cache) | free -hw |
Practical Examples
#1 Human-readable memory
Shows memory usage in human-readable format.
$ free -h
Output:
total used free shared buff/cache available
Mem: 15Gi 4.2Gi 1.3Gi 256Mi 10Gi 10Gi
Swap: 2.0Gi 0B 2.0Gi
#2 Monitor memory
Updates memory display every 5 seconds.
$ free -h -s 5#3 Available memory
Extracts just the available memory value.
$ free -h | awk '/Mem:/{print $7}'
Output:
10Gi
#4 Memory percentage
Calculates memory usage percentage.
$ free | awk '/Mem:/{printf "%.1f%%\n", $3/$2*100}'
Output:
28.0%
#5 Wide output
Separates buffers and cache into distinct columns.
$ free -hw#6 With totals
Shows a total row combining RAM and swap.
$ free -htTips & Best Practices
Free is not available: \"Free\" memory looks low because Linux uses RAM for disk cache. Look at the \"available\" column — it shows actual available memory for applications.
Quick memory check: free -h | grep Mem gives you the essential memory line: total, used, free, and available in one glance.
Swap usage: Consistent swap usage is OK. Active swapping (swap growing over time) indicates insufficient RAM. Monitor with vmstat.
Frequently Asked Questions
How do I check memory usage?
Use free -h. Look at the \"available\" column for actual available memory. \"Free\" is misleadingly low due to disk caching.
Why does free show very little free memory?
Linux uses unused RAM as disk cache (buff/cache). This is automatically released when applications need it. Check \"available\" instead of \"free\".
How much memory is actually available?
The 'available' column in free -h shows memory available for new applications, including reclaimable cache.
Related Commands
More System Information Commands
Master Linux with Professional eBooks
Curated IT eBooks covering Linux, DevOps, Cloud, and more
Browse Books →