Online Linux Terminal Logo
OnlineLinuxTerminal
Disk & StorageCLI Reference

$free

Display total amount of free and used physical memory and swap.

Syntax DefinitionPOSIX standard
free [OPTIONS]
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `free` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How free Works

`free` provides an instant summary of system RAM and Swap memory utilization. It reports total, used, free, shared, buffer/cache, and available memory.

Common Flags & Command Options

Flag / OptionDescription
-h, --humanShow memory values in human-readable units (e.g., 8Gi, 512Mi).
-m, --megaDisplay amounts in megabytes.
-g, --gigaDisplay amounts in gigabytes.

Practical Real-World Examples

Example #1Check human-readable RAM usage

Prints RAM and swap memory in GB and MB.

Sample Output:
total used free shared buff/cache available Mem: 7.8Gi 1.4Gi 4.2Gi 45Mi 2.2Gi 6.1Gi Swap: 2.0Gi 0B 2.0Gi

Frequently Asked Questions

Why does Linux report low free memory when my system is running fine?

Linux uses spare RAM for caching disk files (buff/cache) to boost performance. If applications need memory, the kernel automatically frees the cache instantly. Look at the `available` column for true free capacity.