Wednesday, March 31, 2010

Boot Time of a linux box

Do you want to know the time when a linux machine was started/booted? It's stored in /proc/stat. For easy use, in the standard unix time format display,here's a 1 liner to print it out, in your local timezone:
perl -ne 'print scalar localtime $1 if /^btime (\d+)/' /proc/stat

Ref

Followers