Back to commands

Linux Survival Basics

Read-only

Check Memory Pressure Quickly

A VPS feels slow, and people often restart daemons before checking whether memory pressure is the cause.

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 use it to identify which process is responsible; follow up with ps, top, or systemd-cgtop.

Expected output

A memory table with total, used, free, buff/cache, and available columns.

System impact

Read-only. Nothing changes. free prints total, used, free, shared, buff/cache, and available memory.

Recovery / rollback: no state is changed.

When to use it

Use during slowdowns, deploy validation, memory alerts, or before resizing a VPS.

When not to use it

Do not use it to identify which process is responsible; follow up with ps, top, or systemd-cgtop.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ free -h

               total        used        free      shared  buff/cache   available
Mem:           1.9Gi       1.3Gi       120Mi        12Mi       420Mi       390Mi
Swap:          2.0Gi       128Mi       1.9Gi

$ uptime

 14:34:10 up 2 days,  4:18,  1 user,  load average: 0.32, 0.58, 0.71
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. free -h
  2. uptime

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
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.

  • lpic1:103-gnu-unix-commands
  • lfcs:essential-commands
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

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