↑ ↓ select, Enter open, Esc close

Show uptime and recent reboots

Adjust the values, the command updates live
user@server
uptime -p && last reboot | head -n 10

The first line gives the uptime in words, for example up 3 weeks, 2 days. Below it follow the most recent boots from /var/log/wtmp with kernel version and time span. A boot without a preceding clean shutdown points to a power failure, a crash or a restart by the hosting provider.

Note: The list only goes back as far as logrotate keeps wtmp. The cause of a crash can often be found with journalctl -b -1.

Also searched as

  • when was the server rebooted
  • how long has the server been up
  • unexpected reboot linux

Related one-liners

All in System and hardware

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.