LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   real last modified date... not when copied to machine (https://www.linuxquestions.org/questions/linux-newbie-8/real-last-modified-date-not-when-copied-to-machine-750916/)

mike_stlouis 08-28-2009 12:52 PM

real last modified date... not when copied to machine
 
i copied some file to a linux machine and the only dates i can find with any of the ls options is when it was copied over (all the files have the same "last modified" date as they were all copied at the same time) - but that's not the last modified date i'm looking for... i'm looking for when the jar file was built (and the other files where last changed). how do i see that?
thanx!

forrestt 08-28-2009 01:00 PM

Go back to the original system and look there. It isn't in the current location as you lost it when you copied the files over. There are ways to preserve that info with a copy, but you didn't use any of them.

HTH

Forrest

tronayne 08-28-2009 01:08 PM

... and the stat utility will show you just about everything worth knowing about a file; e.g.,
Code:

stat stuff.sh
  File: `stuff.sh'
  Size: 121            Blocks: 8          IO Block: 4096  regular file
Device: 807h/2055d      Inode: 626        Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/  trona)  Gid: (  100/  users)
Access: 2009-08-28 14:04:16.000000000 -0400
Modify: 2008-06-27 17:14:18.000000000 -0400
Change: 2009-01-25 13:02:22.000000000 -0500

Like forrestt says, no way to know original create date without using, say, the -p (--preserve) option with cp.

b0uncer 08-28-2009 01:17 PM

Correct me if I'm wrong, but (currently, in the common filesystems) creation time is not stored anywhere, only access, change and modification times (when file was accessed, when its properties were changed and when its contents were changed). To me this is perfectly sane (creating a file is modifying that file). I haven't ever found a need to see 'creation time', and I assume if you needed that badly, you could use a database for that need..and if you did keep track of creation dates, would it in the end make any sense, if the files were modified possibly several times, perhaps completely, after that? For example you had a file called notes which was created 21.5.2012, and you looked at it five years later, knowing that it's modification time was updated some thousand times after that -- what would you do with the creation time then? Remembered when you started taking notes? Well, what if you had that file in place already, maybe by accident, and later just wrote your "notes" there -- that would mean that your file was physically created earlier than your "notes" (the file you know that contains your notes) were really created. In my opinion there are some problems here, one of which is that if you transfer your file through a filesystem that doesn't support creation date, you probably lose it anyway, making your system show it created later than it really was.

According to Wikipedia, ext4 "improves" (depends on the needs of the user, I guess..) timestamps compared to ext3, also providing the creation date timestamp. In the same paragraph it's pointed out that it's not enough, though, and you won't be seeing it in use in the near future..so I wouldn't be expecting it, either.


All times are GMT -5. The time now is 11:13 PM.