Check start up date under Linux

Obviously “uptime” provides that information but only gives the number of days. On one of my server, it shows:

01:39:53 up 445 days, 11:15,  2 users,  load average: 0.00, 0.00, 0.00

But when did that happen ? I don’t know any option which can compute the actual date using uptime.

I realized the other day that I can use “ps” to display the same information just by checking start up time for the “init” process.

ps -o lstart -C init | tail -n 1

do the trick and displays:

Sun Sep 30 15:24:22 2007

Whoa ! That’s a long time ago …

Use “alias” if you don’t want remember that:

alias uptime2='ps -o lstart -C init | tail -n 1'

Reply


Twitter Updates
    Archives
    Categories