Back to commands

Hosting Operations

Read-only, can be slow

Find the Processes Burning CPU

You need to identify which processes are using the most CPU without changing system state.

Command

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

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 use it as the only signal for long-term performance diagnosis; pair it with uptime and memory checks.

Expected output

A sorted process list with the highest CPU consumers near the top.

System impact

Read-only, can be slow. Nothing changes. The command reads the process table and sorts by CPU use.

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

Recovery / rollback: no state is changed.

When to use it

Use when load is high or the machine feels slow and you need to find CPU-heavy processes.

When not to use it

Do not use it as the only signal for long-term performance diagnosis; pair it with uptime and memory checks.

next steps

Related commands

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

Show Top Memory Processes

Find current memory owners before restarting workloads.

ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
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 Directories Burning Inodes

Inode cleanup starts by finding the directory with too many files.

find /var/cache -xdev -type f -printf '%h\n' 2>/dev/null | sort | uniq -c | sort -nr | head
Hosting Operations Can be slow

Review Log Files Before Cleanup

Before truncating logs, prove which log files are large and how old they are.

find /var/log -xdev -type f -printf '%10s %TY-%Tm-%Td %p\n' 2>/dev/null | sort -nr | head -50
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.