6

I need to find PC uptime from the day of installation until now.

Is this logged somewhere? Does any file log this cumulative uptime?

Chalist
  • 417

6 Answers6

9

As log-files are usually deleted after some time, the total up-time is difficult to get.

If the hard disk is as old as the PC, the RAW value (last number) of

smartctl  -a /dev/sda | grep Power_On_Hours

could give a rough estimate how many hours the PC was used.

jofel
  • 26,758
5

If you want to keep track of this -from now on- you can use uptimed

It's available as package in Ubuntu and Fedora and probably other distributions as well.

foo
  • 336
  • 1
  • 2
3

If you have some server, use commands like:

$ uptime 
$ w
$ last

HDD SMARTCTL is also good try.

Also from installation could be information about date created of some files in filesystem. Think about, which files were created with installing of your system?

If you have linux, look at the date of creation of your /root/ directory. If you have windows, it will be worse...

chaos
  • 48,171
MIrra
  • 1,257
1

Install tuptime, since that moment, you will have a track of the system uptime.

https://github.com/rfrail3/tuptime

0

Depending on the filesystem, the superblock might have the date the filesystem was created. You'd want to check the root filesystem. There is more information here

Tim B
  • 781
0

I would use this command to find the very first moment of the system creation:

sudo tune2fs -l /dev/sda | grep 'Filesystem created:'