Skip to content

free

10 commands

Shows total, used and available memory and swap.

  • memory
  • performance

Install free

sudo apt install procps

Basics6

free -h

Memory and swap usage in human-readable units. “available” is the realistic figure for new programs.

free -m

Values in mebibytes.

free -g

Values in gibibytes.

free -h -t

Adds a total row for RAM plus swap.

free -h -s <seconds>

Refreshes every n seconds.

Link
free -h -w

Wide mode: separates buffers from cache.

Deeper4

cat /proc/meminfo

The raw kernel memory counters that free reads.

vmstat -s -S M

Memory statistics plus paging and swap activity.

swapon --show

Lists swap devices and how much of each is used.

Link
ps aux --sort=-%mem | head

The processes using the most memory.

Link