I need to find PC uptime from the day of installation until now.
Is this logged somewhere? Does any file log this cumulative uptime?
I need to find PC uptime from the day of installation until now.
Is this logged somewhere? Does any file log this cumulative uptime?
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.
Disk Utility
, but it will give you the uptime since manufacture, not since installation.
– Bernhard
Dec 26 '12 at 09:27
sudo smartctl -a /dev/sda | grep Power_On_Hours
– Joke Sr. OK May 27 '15 at 13:53If 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.
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...
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
I would use this command to find the very first moment of the system creation:
sudo tune2fs -l /dev/sda | grep 'Filesystem created:'