Back to commands

Linux Survival Basics

Read-only, sensitive output

Show Recent Server Reboots

After an outage, deploy, or provider event, you need evidence of reboot timing without guessing from logs.

Command

last -x reboot | head -5

Before you run this

System impact: Read-only. Output may expose users, paths, tokens, keys, IPs, process arguments, or log details.

When not to use it: Do not rely on it if wtmp rotation or cleanup removed older records.

Expected output

Recent reboot rows with boot time and current running status.

System impact

Read-only, sensitive output. Nothing changes. last prints recent reboot records from login history.

Recovery / rollback: no state is changed.

When to use it

Use after provider maintenance, unexpected downtime, kernel updates, or suspected crashes.

When not to use it

Do not rely on it if wtmp rotation or cleanup removed older records.

next steps

Related commands

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

Count Failures by Test File

Turn noisy test logs into a ranked failure list.

grep -RhoE '[A-Za-z0-9_./-]+\.(test|spec)\.(js|ts|py|rb)' logs/ | sort | uniq -c | sort -nr | head
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
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.