Back to lessons

Linux Survival Basics

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

What changed

Nothing changes. last prints recent reboot records from login history.

Danger

safe

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.

Undo or recovery

No undo needed because the command is read-only.

Expected output

Recent reboot rows with boot time and current running status.

demo script

Disposable terminal steps

  1. last -x reboot | head -5
  2. uptime

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ last -x reboot | head -5
reboot   system boot  6.8.0-60-generic Thu Jun 25 14:09   still running
reboot   system boot  6.8.0-60-generic Wed Jun 24 03:12 - 14:08  (1+10:56)
::exit-code::0
$ uptime
 14:34:10 up 2 days,  4:18,  1 user,  load average: 0.32, 0.58, 0.71
::exit-code::0

YouTube Short

When did this VPS reboot?

If a server was down or restarted, confirm the reboot timeline directly before digging through every service log.

LinkedIn hook

Confirm whether the server actually rebooted and when.

Question: Do you check reboot history during every unexplained outage?

experiments

A/B tests to run

Metric: average_view_duration

A: Frame as outage evidence.

B: Frame as post-maintenance validation.