If you are using Ubuntu Linux OS on your computer for a long time and forget the exact installation day and time, then now you can find the exact installation date and time of your Linux OS using below methods and commands.
How long have you been using your Ubuntu Linux OS without a reinstall:
Open the terminal app using ctrl+alt+t keys or from application menu and run below command to switch to root user
Using filesystem creation date:
sudo su
Enter your password. Then run below command.
fs=$(df / | tail -1 | cut -f1 -d' ') && tune2fs -l $fs | grep 'Filesystem created'
This command will output the file system created date and time during the OS installation time and date.
Using stat command:
Open the terminal app and run below command to get the installation date and time
stat -c %w /
Or use the below command to get the date only.
stat / | grep "Birth" | sed 's/Birth: //g' | cut -b 2-11
That’s all. In this way you can get the your Linux OS installation date and time.
stat -c %w /, returned nothing on my Linux Mint v20.2 system.
fs=$(df / | tail -1 | cut -f1 -d’ ‘) && tune2fs -l $fs | grep ‘Filesystem created’, returned Wed Nov 25 10:45:13 2020