List/compare a directory's files' creation and modification dates
I'm sure there is an easy way to do this, but I just can't seem to figure it out. I am trying to find files that have been updated since their original creation date. It would be great to issue a command that will give me this information. I would also be perfectly happy to have some sort of 'ls' command that lists both the creation and modification dates so I can manually check the output for ones that have been updated. Of course the first option is ideal, but right now I'm just looking for any solution.
Is there a command out there that will do this for me? Right now I'm only seeing how to list the modification dates. Thanks so much! Trish |
Try playing around with
Code:
ls -alc |
Unfortunately, the system does not store information about creation time. You can have ctime (change time), mtime (modification time) and atime (access time).
If the file's properties or permissions are changed, ctime changes. If the file is accessed, atime changes. If the file is modified, both atime and mtime change. For new files and files that have not been modified or changed since creation, ctime equals creation time. But, as soon as file properties are changed, and a file is modified, all information about creation time is lost. You only hope is that file properties have not been changed since creation. In that case, access and modification times differ from ctime (with ctime having the earlier date and time). To see all three times, use stat, as in 'stat <filename>'. With stat, and a bit of awk magic (since the stat output is arranged in horizontal records with distinct fields), you could write a script to select files based on differences between ctime and atime or mtime. However, it won't be exact, for reasons stated above. |
Quote:
|
All times are GMT -5. The time now is 08:19 PM. |