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!

find files that are not older then 1 day

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
US
I am trying to use the find command to find all files that are less then a day, week or month old.... The directory looks like it has not been updated in a while and I am trying to make sure of that...

I usually do a find /xxxx -mtime +7 -exec ls -l {} /; and list files older then 7 days.. But it did not seem to work if I try a -7...

Any ideas? I do not have to use find, if there is a better way to accomplish this....

Thanks......
 
I've seen something like this using touch and then the -newer flag to find:

touch -t 200509030000.00 /tmp/flagfile

where the -t value equates to the date beginning the period you are searching for. Then:

find /path/to/search -type f -newer /tmp/flagfile >list.txt

to list the found files to list.txt
 
Thanks... I love simple solutions for simple problems....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top