Back to commands

Linux Survival Basics

Read-only

Find Slow Services During Boot

A server comes back after reboot, but boot time feels long and there is no obvious culprit.

Command

systemd-analyze blame | head -20

Before you run this

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

When not to use it: Do not assume the top line delayed the whole boot; follow up with systemd-analyze critical-chain.

Expected output

Startup durations sorted from slowest to fastest.

System impact

Read-only. Nothing changes. systemd prints units ordered by startup duration.

Recovery / rollback: no state is changed.

When to use it

Use after slow reboots, maintenance windows, or image changes that affect startup time.

When not to use it

Do not assume the top line delayed the whole boot; follow up with systemd-analyze critical-chain.

next steps

Related commands

Linux Survival Basics Sensitive output

Show Recent Server Reboots

Confirm whether the server actually rebooted and when.

last -x reboot | head -5
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
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
Linux Survival Basics Read-only

Find the Largest Installed Packages

Disk cleanup starts with evidence, not random package removal.

dpkg-query -W -f='${Installed-Size}\t${Package}\n' | sort -nr | head -20
Linux Survival Basics Can be slow

Find the Largest CI Logs

Huge logs often point to loops, noisy tests, or runaway debug output.

find logs/ -type f -printf '%s %p\n' | sort -nr | head -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
  • Linux+ style troubleshooting review

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