Operating System - HP-UX
1753902 Members
9324 Online
108810 Solutions
New Discussion юеВ

Re: locate files created after a certain date

 
Rahul_13
Advisor

locate files created after a certain date

Hi,

I am writing a script which requires listing of files that are created after a certain date. Also, I want to take the date as the input to this script.

Can anyone please help.

Thanks,
Rahul
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: locate files created after a certain date

Sorry, there is no way to do this because the file creation time is not carried as part of the file's metadata. You only know the creation time by accident if one of the 3 timestamps (mtime - modification, ctime - change time (meaning mode or ownership change), or atime (access time) happens to coincide with the actual time the file was created. You need to change your question. If you can change your question to use one of the 3 timestamps then the find command can be of help. Man find for details and examples.
If it ain't broke, I can fix that.
Hein van den Heuvel
Honored Contributor

Re: locate files created after a certain date


Rahul,

Please try the 'more options' = advanced search at the top of the page.

Search for 'find date'
- all words
- hpux
- subject only

You'll find dozens of prior questions and answers in this space. Sneak preview of the most common answer:
- Use 'touch' to create a file with the desired reference date
- Use 'find -newer' to compare against the date of the reference files.


The man pages will explain details...

Hein.