Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find files created in a specific day?

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
eg. I would like to find files which were created in July 16th.

thx in advance,
 
Unix doesn't care or keep track of when files are created...

To find files changed/updated on July 16th
create an empty file dated July 15th 23:59:59
create an empty file dated July 17th 00:00:00
==> man touch
Find files with modify timestamp between those two files
==> man find (-newer and ! -newer)

Perhaps if you run a backup tool like daily TSM incremental, TSM may be able to find out the creation date of files?


HTH,

p5wizard
 
If you use a tool like perl or 'C' you will have access to three file atributes, ctime, atime and mtime which are creation time, access time, and modified time. That's the good news. The bad news is that none of these are to be trusted.

mtime is the most accurate of the lot but can be easily altered using 'touch' so is insufficient for a proper audit.

ctime is actually the modify time of the inode. In many cases this will equal creation time but, again, you shouldn't rely on it.

atime is the last time the file was read but is even more unreliable.

Having said all this most versions of find allow for the -ctime flag so, will all the provisos in mind,
Code:
find /path -ctime 3
will find all the files created three days ago.

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top