S
S
Sinucs2014-02-19 08:49:17
ubuntu
Sinucs, 2014-02-19 08:49:17

How can I find out the exact time when my Ubuntu computer was turned on?

There are several computers on Ubuntu, they turn on at different times.
According to the specifics of the work, I need to know exactly what time they turned on.
I didn't find anything interesting in /var/log/ (or didn't search well).
Later I will send this turn-on time from the log to the crontab by mail to myself.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
E
egor_nullptr, 2014-02-19
@Sinucs

ps -o lstart 1 | tail -n 1
Instead of lstart, you can also use bsdstart or start, see for yourself which output format is more convenient for you.
You can also do this:

dmesg | grep "RTC time" | awk -F"RTC time:" '{print $2}' | sed [email protected]:@@
this will be the date and time in UTC (the first method returns local time).

S
sonik_spb, 2014-02-19
@sonik_spb

uptime command =)

M
mitinsky, 2020-02-28
@mitinsky

uptime -s

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question