Posted: . At: 2:29 PM. This was 4 years ago. Post ID: 14189
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to find the date and time your Linux machine last booted up.


Finding out when your Linux machine actually booted up can be tricky. This is how to do it though. The date command can be used with other commands to easily give this information.

4.4 Fri Mar 27 jason@Yog-Sothoth 0: $ date -d @`grep btime /proc/stat | awk '{ print $2 }'`
Fri 27 Mar 06:47:22 AEDT 2020

The above one-liner will help you out and give you all of the information you need. Instead of using the uptime command and then counting backward to get this information, just use this simple command.

Although the uptime command can do this, it shows a slightly different time.

4.4 Fri Mar 27 jason@Yog-Sothoth 0: $ uptime -s
2020-03-27 06:47:23

But it does work well.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.