1834939 Members
2344 Online
110071 Solutions
New Discussion

Re: find command

 
Steve_3
Frequent Advisor

find command

Can you use FIND to find files base on hours.
I am trying to find files that are older than 4 hours..

What can I use?

thanks..
steve
3 REPLIES 3
Curtis Larson
Trusted Contributor

Re: find command

use the -newer option

touch -t reference_time some_file
find .... -newer some_file

and, of course, older would be ! -newer
federico_3
Honored Contributor

Re: find command


I would do like this:

Let's suppose that we want to find files older than 5 hours :

touch -t 0101190830 file ( 01 year, 01 mounth, 19 day, 08 hour, 30 minutes)

find DIR ! -newer file -print

I hope this help
federico
Carlos Fernandez Riera
Honored Contributor

Re: find command


Add -type f to find

find DIR -type f -newer touchedfile
unsupported