Linuxlab

free command in Linux: memory usage

Updated July 3, 2026

The free command shows how much RAM is used, free, and cached.

Syntax

free [-h]

Common cases

free -h            # human-readable sizes: K, M, G
free -m            # in megabytes
free -s 2          # refresh every 2 seconds
cat /proc/meminfo  # the source of these numbers

How it works: read available, not free

A healthy system has almost no free memory, and that is fine: the kernel gives unused memory to the disk cache to speed up reads, and hands it back to a program on demand. So you read the available column, not free - that is how much memory programs can really use without swapping. The warning sign is not a low free but rising swap together with a low available.

Used in

You need this in the lesson Monitoring. The theory is the chapter Monitoring and bottlenecks.

See also

The vmstat command, Load average, The /proc filesystem.

Try it

Open the sandbox: a real throwaway Linux terminal in your browser. Run the commands above by hand - the container is deleted when you leave.