Showing install date of a Linux system

there used to be a command that you run in linux terminal that displays the date your system was installed.
i just cant remember it, and cant find it anymore.
does anyone know that command?

I am not aware of such single command for this purpose. You may use this as reference: https://unix.stackexchange.com/questions/9971/how-do-i-find-how-long-ago-a-linux-system-was-installed

These commands will show you, how long you have been logged in and when installed, time and date.

  • uptime
  • ls -ld /var/log/installer
  • ls -ld /lost+found

i.e, when I upgraded my laptop from a 120Gb m.2sata to 500Gb

xxxx@xxxx:~$ ls -ld /lost+found
drwx------ 2 root root xxxxx Aug 1 14:19 /lost+found
xxxx@xxxx:~$

2 Likes

This should help

But not sure why you want to know this also if you update your system some of these files will be overwritten and may give false results

2 Likes

interestingly enough, lost+found gave me the correct date (i made some notes on my phone about the new install, so the date was saved there as well). somehow installer shows one month earlier? this was a fresh install of the 18.04 base (bodhi 5.0) over an existing 16.04 (bodhi 4.5) one, but even if somehow installer managed to survive that transition, it would have been from a much different date.

not criticizing, mind you :slight_smile: just sharing my results because i thought this was an interesting question and wanted to see how my results compared.

2 Likes

worked for me just fine, but my install was just over 90 days ago so maybe i haven’t written over anything you were suggesting yet?

1 Like

Okay tried all of these. .uptime gave the correct time I had been on today and how long I had been on for. .ls-Id/var/log/installer gave me the correct time and date I had completed my install. Is-id/lost+found gave the correct root time. So I had no problems with any of them or the results. The Is command is pretty useful for many things and I have a copy of simple commands, but I can’t remember where I got it from, (if I remember later I’ll open a new thread with them). Thanks for this @anon56357095 I am sure many will be interested in this - nice reply :grinning:

3 Likes

A month…? Mmmmm, experience usually is approximately a few minutes between both. :thinking:

Interestingly, on my Manjaro machine and it doesn’t recognise the ls -id /var/log/installer command.

[xxxxx@xxxx ~]$ uptime
11:40:48 up 1:12, 1 user, load average: 0.90, 0.84, 0.83

[xxxx@xxxx ~]$ ls -ld /var/log/installer
ls: cannot access ‘/var/log/installer’: No such file or directory

[xxxx@xxxx -7470 ~]$ ls -ld /lost+found
drwx------ 2 root root 16384 Oct 11 15:01 /lost+found

[xxxx@xxxx ~]$

To quote the Debian wiki (from memory) when diagnosing OS or hardware issues, there could be a multitude of reasons, but do not dismiss solar flares, that could cause such anomalies.

:grinning:

2 Likes

:grinning:

3 Likes

need’s root access (sudo su)

Noticing if you upgrade it doesn’t re-stamp it.

1 Like

need’s root access (sudo su)

Noticing if you upgrade it doesn’t re-stamp it.

Nope!

As I pointed out earlier, see reply to cordx, Manjaro does not recognise this command, as ordinary or root user, whereas Debian and Ubuntu derivatives do.

[xxxx@xxxx ~]$ ls -ld /var/log/installer
ls: cannot access ‘/var/log/installer’: No such file or directory
[xxxxy@xxxx ~]$ sudo ls -ld /var/log/installer
[sudo] password for xxxx:
ls: cannot access ‘/var/log/installer’: No such file or directory
[xxxx@xxxx ~]$ sudo su
[xxxx xxxx]# ls -ld /var/log/installer
ls: cannot access ‘/var/log/installer’: No such file or directory
[xxxx xxxx]#

:wink:

1 Like

I’d assume that’s normal for arch based distro’s

AND …just checked it’s not in Fedora either

1 Like