How can I find the time since a Linux system was first installed, provided that nobody has tried to hide it?
|
This will tell you when the file system was created. * = In the first column of |
|||||||||||||||||||||
|
|
Check the date of the root filesystem with dumpe2fs. I can't really think of how that could be anything other than the date you're looking for:
|
|||||||||||||||||||||
|
|
There are a few dates lying around.
On Debian or Ubuntu and their derivatives, see But beware this is not guaranteed. (see other answers/comments for some of the reasons it may not work.) |
|||||||||||||||||||||
|
|
In Fedora, anaconda installer stores the config details of your install in root's home folder, that can give you some idea. On Debian (at least more recent ones), several logs from the install are stored in |
||||
|
|
|
As requested by OP. If you are looking for the time, when the system was setup, there isn't a way to determine that. For one, the system might have been cloned (not installed) which would effectively fake the file creation time. You can estimate the age by searching for oldest files. |
|||||
|
|
On Red Hat based distributions (e.g. CentOS, Scientific, Oracle etc) you can use:
or
|
|||||
|
|
The solution most neutral to filesystem and distribution (that I can come up with) is to use the oldest file given by I think it's best to look at files rather than directories since directories do change their creation time metadata when their contents change (perhaps somebody can shed light on why that is?)
Systems that lack GNU Coreutils should remove the On other non-Linux systems, Also note that If you want to get fancy and get just the creation time of the oldest file in
This command worked for me on an old FreeBSD system (UFS, no GNU utils):
(Yes, this parses You can also use |
|||
|
|
|
|||
|
|
|
I have been looking for similar tool, and the best I could come up with was |
|||
|
|
|
I look at the oldest file in /boot (top of "ls -ltr /boot". Often there is an original boot sector from the first install there. On my oldest system this gives the date of original installation, despite having replaced everything in the machine and copied the contents of the file system around a few times :) |
|||
|
|
|
|
|||||||||||||
|
|
Please run as follows:
And then use the below command.
|
||||
|
|
|
Since a time ago, I usually install at the sime time that the linux distribution a package called Tuptime, which keeps useful statistics about the running time, startups, shutdowns... For your questions, the line "System life" have that information. As example:
More info: https://github.com/rfrail3/tuptime/ |
|||
|
|
|
I found a simple file. name "1". Maybe is the first file.
|
|||||
|