|
Home > Archive > Unix Shell > January 2007 > list files based on time change
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
list files based on time change
|
|
| tester 2007-01-22, 7:20 pm |
| Hi Gurus,
I want to search for all files/folders from root which are
changed/modified TODAY and generate a list of those in a file after say
9:00 AM ownwards. I tried find it doesn't work for TODAY.
Any help is greatly appreciated.
Regards
| |
| Bill Marcum 2007-01-22, 7:20 pm |
| On 22 Jan 2007 12:42:13 -0800, tester
<bshah@citadon.com> wrote:
>
>
> Hi Gurus,
> I want to search for all files/folders from root which are
> changed/modified TODAY and generate a list of those in a file after say
> 9:00 AM ownwards. I tried find it doesn't work for TODAY.
> Any help is greatly appreciated.
> Regards
>
man touch
find -newer
--
Save the whales. Collect the whole set.
| |
| Michael Paoli 2007-01-23, 1:26 am |
| Bill Marcum wrote:
> On 22 Jan 2007 12:42:13 -0800, tester
> <bshah@citadon.com> wrote:
> man touch
> find -newer
That will work for mtime, but the original post is a bit ambiguous.
Does the poster want files selected by mtime, or by ctime? The mtime
(nominally the time of last modification) is user settable, and thus
doesn't necessarily actually reflect when a file was last changed.
The ctime, however is a timestamp of higher integrity. It will be
updated when most anything about a file is changed, and also, if the
mtime or atime (time of last access) are explicitly set (they are
user settable) to anything other than defaulting to use of the
current time, that has the side effect of updating the ctime to the
current time.
Some find implementations, e.g. GNU find, also include -cnewer, which
works similar to -newer, except the ctime of the file find is
examining is compared to the mtime of a reference file (the argument
to the -cnewer option). GNU find also has the option -daystart,
which could be quite handy. PERL also has useful find capabilities.
See also: stat(2), utime(2), perl(1), File::Find (3perl)
|
|
|
|
|