Linux Survival Basics
Read-only, sensitive outputShow 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
Find Slow Services During Boot
Find which units made your VPS boot slowly.
systemd-analyze blame | head -20
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
Show Top Memory Processes
Find current memory owners before restarting workloads.
ps -eo pid,comm,%mem,%cpu --sort=-%mem | head
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
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.