Operating System - Linux
1756925 Members
3654 Online
108857 Solutions
New Discussion юеВ

Re: Need the list of files which created in specific time

 
SOLVED
Go to solution
James R. Ferguson
Acclaimed Contributor

Re: Need the list of files which created in specific time

Hi:

> I got following error on my system
Can't locate File/Find.pm in @INC (@INC contains: /opt/perl5/lib/5.00502/PA-RISC1.1 /opt/perl5/lib/5.00502 /opt/perl5/lib/site_perl/5.005/PA-

You have a very old Perl on your server. The 'File::Find' module wasn't part of the Perl Core distribution at that time.

I suggest that you download and install a current Perl. No reboot is necessary!

http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=PERL

...and if per chance this is an old 10.20 system, Merijn has a Perl for that:

http://mirrors.develooper.com/hpux/downloads.html

Perl 5.8.8 is an excellent version for production. Perl 5.10 was recently released too.

Regards!

...JRF...

Re: Need the list of files which created in specific time

Touch a reference file (say /tmp/ref_file) with a specific timestamp that corresponds to approx 1 hr ago using:
touch -t CCYYMMDDhhmm.SS /tmp/ref_file

run a find:
find start_dir -type f -newer /tmp/ref_file

as per "man find":
-newer file True if the current file has been modified more recently than the argument file.


James R. Ferguson
Acclaimed Contributor

Re: Need the list of files which created in specific time

> Rangarajan :

Why resurrect a 10-day old thread that has a bunny and for which your alternate proposal was first suggested by someone else on the opening day?

While 'find -newer ...' certainly works, it doesn't provide the moving window of time yielded by the Perl snippet I showed. Of course, you could wrap a 'touch' and a 'find' in a small shell script that creates the reference point; performs the 'find' and then removes the (then) useless reference file.

Regards!

...JRF...
VVS
Regular Advisor

Re: Need the list of files which created in specific time

Thanks all of you for your information
Work is life, you know, and without it, there's nothing but fear and insecurity.