* SUMMARY: Searching for new files?
[not found] <ED9FF2AF91C4DA42BA4BB8372DBC8C9710D46E@VESTMB202B.tdk.dk>
@ 2002-09-02 15:24 ` Tom Linden
0 siblings, 0 replies; only message in thread
From: Tom Linden @ 2002-09-02 15:24 UTC (permalink / raw)
A number of responses all based on, find.
Original Question
>> Does anyone ahave a method to find all files
>> modified or created since or before a certain
>> date?
>
>The easiest way to find all the file that are newer than a certain date is
>to touch a file using the -t option to set the date/time and then use the
>find command. For example to find all the file that are newer than
>9:29pm on
>the 1st September, use the following commands:
>
>touch -t 09012119 timestamp_file
>
>find /path -newer timestamp_file
>
>By adding the -type option, the find command can be limited to files, link,
>directories, etc.
>
>If you wish to find files that are older than that date/time, use the
>command:
>
>find /path ! -newer timestamp_file
>
>Hope this helps,
>
>Michael Bradford
and from Gavin Kreuiter [gavin@dhsolutions.co.za]
Two ways, both using find:
If you want files newer than a number of days, use:
find / -type f -mtime -NUMBER
Where NUMBER is the number of 24-houtr periods. For example, finding
all files modified in the last 48 hours:
find / -type f -mtime -2
Alteratively, use "touch" and the -newer option of find:
touch -t 200112312359 ref
find / -type f -newer ref
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
^ permalink raw reply [flat|nested] only message in thread