What's new

Display boot time

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

smasher

Regular Contributor
Just thought I'd share this one-liner to display device boot-time.
Code:
date -d@$(( $( date +%s ) - $( cut -d. -f1 < /proc/uptime ) ))

Of course the output format can be customised with all of the usual format strings for "date".

Tested and working spectacularly on an AC68U. The displayed boot time may vary by one second between invocations, because the calculation is limited to one second of precision.
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top