1

I have a raspberry pi but I do not recall when I set it up. I am trying to find this out. I have tried the suggestion in the following question:

https://unix.stackexchange.com/questions/9971/how-do-i-find-how-long-ago-a-linux-system-was-installed

(summarized as sudo tune2fs -l /dev/mmcblk0p2|grep 'Filesystem created' ).

This only shows when the raspbian image was created by the foundation.

7
  • 2
    Just out of curiosity why is this important? Jan 6, 2017 at 1:03
  • @SteveRobillard I don't understand the purpose of your question so I cannot answer it.
    – John Smith
    Jan 6, 2017 at 1:26
  • 1
    Why do you need to know the date the system was setup? What value des this have? How are you planning to use this date? Jan 6, 2017 at 1:30
  • That command shows when the disk (SD card in this case) was formatted and assumes the system was installed right after that. If that is not what you are after, then you need to clarify what you mean by "when I set it up".
    – SiKing
    Jan 6, 2017 at 15:54
  • 1
    @SiKing . The command seems to show when the disk image was created at the raspberry pi foundation. I have several machines which I created over a time period and they all have the same date because they were built from the same disk image.
    – John Smith
    Jan 6, 2017 at 16:30

2 Answers 2

2

Find /var/log/syslog. This file has likely been rolled over, and the old versions will have suffixes that are either plain numbers or dates. Find the oldest one by modification time:

ls -l /var/log/syslog.*

Start skimming it from the beginning. Because the Pi doesn't have a clock, the first dates you will find will be Dec. 1969. The first realistic date will be the first one the OS was aware of.

Note that depending how old the installation is, the oldest archived logs may have been purged.

2

The most effective way I have found is using the command

passwd -S

This works if you only changed your password on the day it was setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.