Back to commands

Linux Survival Basics

Read-only, can be slow

Show Top Memory Processes

You need a sorted process list by memory use.

Command

ps -eo pid,comm,%mem,%cpu --sort=-%mem | head

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not kill a process before identifying owner, service, and workload role.

Expected output

The highest memory processes with PID, command, memory percent, and CPU percent.

System impact

Read-only, can be slow. Nothing changes. The command reads current state and prints diagnostic evidence.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use during high-memory or OOM triage.

When not to use it

Do not kill a process before identifying owner, service, and workload role.

Example run

Commands shown

These are the commands shown for inspection. Treat them as an example, not proof that your system will behave identically.

  1. ps -eo pid,comm,%mem,%cpu --sort=-%mem
  2. ps -eo pid,comm,%mem,%cpu --sort=-%mem | head

next steps

Related commands

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 Burning CPU

A server feels slow, but you need proof before restarting anything.

ps -eo pid,ppid,stat,pcpu,pmem,comm,args --sort=-pcpu | head -n 10
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
Linux Survival Basics Can be slow

Find the Files Eating Your Disk

The disk was full, but guessing at folders was the slow part.

find /var -type f -printf '%s %p\n' | sort -nr | head -20

next diagnostic step

Where to go from this command

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
  • Linux+ style troubleshooting review

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