How to find the last reboot time and date on Linux

How to find last reboot time and date on Linux

Sometimes, in so many cases you want to find out and know what is the last time you rebooted your system, to do so you have to use the "last" command or "who" command.

The who command

The standard Unix command who displays a list of users who are currently logged into the computer. The who command is related to the command w, which provides the same information but also displays additional data and statistics.

We are interested in the -b or --boot option that displays the time of the last system boot

who -b
#         system boot  2018-08-19 12:17

The last command

The last command are used to read and access to the binary files called wtmp which stores and records every login and logout event in our lnux system. Each record got by the last command will contain the username, the terminal where they logged in, the ip adrress of the machine, the login time and date stamp and finally the duration of the session.

last reboot | head -1
# reboot system boot Sun Jul 29 15:15  - 05:16 (13:13)