Checking Memory Usage (free)
Concept & Overview
Imagine your laptop starts lagging, web pages freeze, and switching apps feels painfully slow. This usually means your computer is running out of active memory (RAM). In Linux, we can check how much breathing room our system has using the free command.
- The free command shows total, used, and available physical memory (RAM) and swap space.
- Adding the -h flag (running free -h) formats the memory sizes into easy-to-read gigabytes (GB) and megabytes (MB) so you can tell if a program is eating up all your resources.
Why this matters: If you run free without -h, memory usage is printed in raw kilobytes (e.g., 16323456 instead of 16G), which is difficult to interpret quickly. The -h flag automatically scales the numbers to gigabytes (G) or megabytes (M) for easy reading.
free -h.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
free -h | Display RAM usage in human-readable format |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run "free" with the -h or -m option
Ready to complete Quest 52?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.