Page 1 of 1

file/dir dates from BEFORE I installed?

Posted: Thu Jul 12, 2018 1:50 am
by lazarus
LM 18.3 Cinnamon x64

This was a fresh installation on 19 Jun '18 and while familiarising myself with the directory structure, I noticed something odd...

Code: Select all

lazarus@Beelzebub / $ ls -l
total 96
drwxr-xr-x   2 root root  4096 Jun 20 16:51 bin
--8<--
drwxr-xr-x   2 root root 12288 Jul  9 20:29 sbin
drwxr-xr-x   2 root root  4096 Nov 24  2017 srv
dr-xr-xr-x  13 root root     0 Jul 12 15:15 sys
drwxrwxrwt  14 root root  4096 Jul 12 15:17 tmp
drwxr-xr-x  10 root root  4096 Nov 24  2017 usr
drwxr-xr-x  12 root root  4096 Nov 25  2017 var
Now, I assume that ls returns a default of atime? In which case /srv, /usr & /var were last accessed 6 months before the install?

Looking at ctime:

Code: Select all

lazarus@Beelzebub / $ ls -lc
total 96
drwxr-xr-x   2 root root  4096 Jun 20 16:51 bin
--8<--
drwxr-xr-x   2 root root 12288 Jul  9 20:29 sbin
drwxr-xr-x   2 root root  4096 Jun 19 13:49 srv
dr-xr-xr-x  13 root root     0 Jul 12 15:15 sys
drwxrwxrwt  14 root root  4096 Jul 12 15:17 tmp
drwxr-xr-x  10 root root  4096 Jun 19 13:49 usr
drwxr-xr-x  12 root root  4096 Jun 19 13:49 var
Everything looks good there; actually they're among the very few dirs that still have a ctime equal to their creation date! But given the atime stamps. something doesn't add up. Is this likely to cause any problems down the line?

Or is it merely a minor hiccup such that any 'fixing' would be pointless for anything except soothing my OCD? :oops:

(FWIW, there are a few other files in /home that show similar discrepancies but I'm nowhere near as concerned about them as I am about system files...)

Re: file/dir dates from BEFORE I installed?

Posted: Thu Jul 12, 2018 3:10 am
by smurphos
They are the date's they were created on the ISO image you've installed. Nothing to worry about.

Re: file/dir dates from BEFORE I installed?

Posted: Thu Jul 12, 2018 3:49 am
by Mute Ant
"...I assume that ls returns a default of atime..." That turns out not to be the case

man ls "...instead of default modification time..."

Re: file/dir dates from BEFORE I installed?

Posted: Thu Jul 12, 2018 4:28 am
by lazarus
Thanks. In retrospect, mtime makes more sense.
Mute Ant wrote: Thu Jul 12, 2018 3:49 am "...I assume that ls returns a default of atime..." That turns out not to be the case

man ls "...instead of default modification time..."
Heh. Yeah, I read that part of the man differently, as "instead of default modification time: atime..." the inference being that atime is the default.

Now if they'd referred to it as mtime instead... :roll:

Re: file/dir dates from BEFORE I installed?

Posted: Thu Jul 12, 2018 1:10 pm
by GS3
I noticed something similar in Windows. I would download a file to my disk and Windows would report something like "Date created: Jul 12, 2018", "Date modified: April 8, 2012".

At first I was confused that a file could be modified before it was created but then I understood the creation date is when this copy was created on this disk, not when the original file was created elsewhere. So it is correct that the file was last modified years ago but was created minutes ago.

It is important to understand what exactly the parameters and attributes mean. Also, a file has the same contents if copied between different OS and hard disk formats but the attributes are not part of the file and are different from one OS to another and can be lost or modified when copying. For instance, Linux has an *executable* attribute which Windows does not have. Copy a file from Linux to Windows and then back to Linux and the original value of that attribute is lost.