Answers to: i need to know when a linux distro was installed on the systemhttp://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system<p>Please give an example as well instead of just the syntax</p>enTue, 18 Oct 2016 21:41:02 -0400Answer by lsatensteinhttp://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3624<p>The above will be effective on reboot. With the Gnome Interface, when you click on a user name, the System name and the timestamp will appear while you enter the paassword.</p>lsatensteinTue, 18 Oct 2016 21:41:02 -0400http://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3624Answer by lsatensteinhttp://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3623<pre><code>#!/bin/bash # # This script generates a one liner file which is positioned on the # Gnome Logon Screen above the first name on the list. The intention # is to present a message to the user, prior to his logging # into the system. However, this script serves to identify the system # being logged into by using a field from /etc/os-release # The script has been tested with SUSE, and Fedora (2 versions) # It is GPL'd -- no license. Do with it what you want. I take # No responsibilities if the message is too long or too short. # or the message is inappropriate. # # Version Sun Jan 16 18:33:29 # Author Leslie Satenstein # create a message on the logon screen. #echo "Run as sudo $0" ######################################################################### function TEST_FOR_ROOT_ACCESS # { # if [ $EUID -ne 0 ]; then # echo "" # echo "##################################################" # echo "# You cannot run as user $LOGNAME " # echo "# You cannot run as user $LOGNAME " # echo "# You cannot run as user $LOGNAME " # echo "# " # echo "# You must run as root " # echo "# You must run as root " # echo "##################################################" # echo "" # exit 1 # fi # } # # # ######################################################################### TEST_FOR_ROOT_ACCESS #root access ? #setup vars DIR1=/tmp/ DIR2=/tmp/ DCONF="echo" # ====================================================== # If testing, comment out the following three lines # or modify this script # and uncomment (if not done) the preceding three lines # ====================================================== DIR1=/etc/dconf/profile #redefine DIR2=/etc/dconf/db/gdm.d #redefine DCONF=dconf #redefine # if [ ! -f $DIR1/gdm ]; then # Following does the same as previous 3 with 1 line echo -e "user-db:user\nsystem-db:gdm\nfile-db:/usr/share/gdm/greeter-dconf-defaults" &gt; $DIR1/gdm fi mkdir -p $DIR2 # Following are typical contents of /etc/dconf/db/gdm.d/01-banner-message P1="banner-message-text='" P2=$(grep PRETTY_NAME /etc/os-release | cut -d\" -f2) if [ -d /boot/lost+found ]; then P3=$(stat /boot/lost+found | grep ^Modify | cut -d' ' -f2-| cut -d'.' -f1) else P3=$(stat /boot | grep ^Modify | cut -d' ' -f2-| cut -d'.' -f1) fi echo "installing to $DIR1 and $DIR2" echo "[org/gnome/login-screen]" &gt; ${DIR2}/01-banner-message echo "banner-message-enable=true" &gt;&gt; ${DIR2}/01-banner-message echo "$P1$P2 installed on\\r\\n$P3'" &gt;&gt; ${DIR2}/01-banner-message echo "#Created by $0 at $(date)" &gt;&gt; ${DIR2}/01-banner-message ${DCONF} update echo -e "$P2\ninstalled on: $P3" exit 0**strong text** </code></pre>lsatensteinTue, 18 Oct 2016 21:38:27 -0400http://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3623Answer by lsatensteinhttp://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3617<p>If it is a new Linux system, you can look at the timestamp of /boot/lost+found.</p> <p>If it is not there, for RedHat type systems try the timestamp of /etc/os-release</p> <p>For example, my system was installed:</p> <p>[root@scientific etc]# ls -l os-release -rw-r--r--. 1 root root 484 Feb 24 12:33 os-release</p>lsatensteinTue, 05 Apr 2016 08:30:38 -0400http://linuxexchange.org/questions/3452/i-need-to-know-when-a-linux-distro-was-installed-on-the-system/3617