Back to commands

Linux Survival Basics

Read-only

Check Memory Pressure with free

The machine feels slow or unstable, and you need to tell whether Linux is actually short on usable memory or simply using RAM for cache.

Command

free -h

Before you run this

System impact: Read-only. Low when scoped to the shown target.

When not to use it: Do not panic over a small `free` column by itself. Linux cache is normal; low `available` memory plus swap pressure is the stronger warning.

Expected output

A memory summary showing total, used, free, buff/cache, available, and swap; the `available` and swap lines are usually the first ones to interpret.

System impact

Read-only. Nothing changes. The command displays memory and swap totals from the running system.

Recovery / rollback: no state is changed.

When to use it

Use early in performance triage to check `available` memory, cache, and swap before blaming a specific process.

When not to use it

Do not panic over a small `free` column by itself. Linux cache is normal; low `available` memory plus swap pressure is the stronger warning.

next steps

Related commands

Linux Survival Basics Can be slow

Spot OOM Kills in the Kernel Journal

Exit code 137 often means the kernel has something to say.

journalctl -k --since "2 hours ago" --no-pager -o short-iso | grep -Ei 'out of memory|oom|killed process'
Linux Survival Basics Can be slow

Find the Processes Using Memory

The server felt slow. Memory pressure was the first thing to rule out.

ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
Hosting Operations Can be slow

Find the Processes Eating Memory

Memory pressure can look like a slow app, a stuck deploy, or random crashes.

ps -eo pid,ppid,stat,pcpu,pmem,rss,comm,args --sort=-pmem | head -n 10
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • LPIC-1 style command-line practice
  • LFCS style performance-task practice

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.