↑ ↓ select, Enter open, Esc close

Show logs from the previous boot

root@server
journalctl -b -1 -n 200 --no-pager

-b -1 selects the previous boot and -n 200 shows its last 200 lines, which are the minutes before the restart or crash. There you can see, for example, the OOM killer, kernel errors or a regular shutdown. journalctl --list-boots lists all stored boots with their time range.

Note: Only works with a persistent journal. If the directory /var/log/journal is missing, journald keeps logs in RAM only and the logs of earlier boots are lost.

Also searched as

  • why did the server reboot
  • logs before the crash
  • journalctl last boot
  • what happened before the reboot

Related one-liners

All in Logs

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.