Linux Terminal Command: free
The free command is an essential tool in System Information & Hardware. In this tutorial, we will explore what free does, look at everyday examples, and cover advanced options to supercharge your command-line workflow.
Concept & Explanation
The free command displays system RAM and Swap usage, including cache, buffers, and available memory.
Common Options & Syntax
free [options] [arguments]
Here are the most common flags used with free:
- Simple Usage: Basic default commands.
- Detailed View: Shows diagnostic information.
- Advanced Actions: Can chain parameters for scripting.
1. Interactive Example (Simple)
Here is how most people run the command:
# Example
free -h
What it does: Displays system memory usage in human-readable units.
2. Power-User Example (Advanced)
For scripting and advanced diagnostics, use this configuration:
# Advanced
free -hs 5
What it does: Displays memory statistics in human-readable form, refreshing the output every 5 seconds (-s 5).
⚙️ Warning & Common Pitfalls
[!WARNING] Do not judge available memory based on the ‘free’ column alone. Linux uses unused memory for caching (
buff/cache). Refer to the ‘available’ column for actual memory capacity.
🔗 Related Commands
Here are some related posts on cli_tty1 you might want to check out: