Linux – Getting date and time of system startup in Linux


I know that uptime prints the time a machine has been up and running, but is there an easier (reliable) way to get the date of the start up than counting down from this output?

I tried looking around /proc, but didn't find anything of relevance. There's also a line like this on my dmesg:

[    0.673492] rtc_cmos rtc_cmos: setting system clock to 2011-03-14 14:26:52 UTC (1300112812)

But I'm wondering if this method is distribution and kernel version agnostic?

Best Answer

I found some commands here. Try who -b or last reboot | head -1.
who gives numeric dates, while last reboot returns abbreviated day / month names.

Related Question