0

as all know with uptime we can capture the days that machine is up

# uptime
12:08:19 up 93 days, 14:12,  1 user,  load average: 0.38, 0.36, 0.40

what we actually need is to know the date of the reboot / restart

for example - 21/5/2016 12:98

uptime command not have the right flags to do that , so maybe with other commands ?

but after google searching I not find what I want ,

So I will happy to get any suggestion

dandan
  • 1,081
  • 4
  • 13
  • 21

2 Answers2

1

who -b will show the last boot time.

Sven
  • 98,649
  • 14
  • 180
  • 226
0

You can get it to the nearest day with:

date -d "now - $(date | awk '{print $3}') days"

Further parsing of the output of date to extract the hours and minutes

Unbeliever
  • 2,336
  • 1
  • 10
  • 19