?

Log in

No account? Create an account

GEEK: How to find all the files that changed on a given date? - Open Knowledge — LiveJournal

Mar. 9th, 2007

12:55 pm - GEEK: How to find all the files that changed on a given date?

Previous Entry Share Next Entry

Here's what I came up with:

touch -t 200702270000 /tmp/date_marker
touch -t 200702280000 /tmp/date_marker2
find / -newer /tmp/date_marker -and \! -cnewer /tmp/date_marker2 -exec ls -ld {} \;

But that seems pretty kludgy. Anyone have a better suggestion?

Thanks!

Comments:

[User Picture]
From:danlyke
Date:March 9th, 2007 11:49 pm (UTC)

Nope, that's what I'd do.

(Link)
If I've got something really complex I may use Perl's File::Find module, but touch and -newer is the sort of thing I usually do.
(Reply) (Thread)
[User Picture]
From:crasch
Date:March 9th, 2007 11:52 pm (UTC)

Re: Nope, that's what I'd do.

(Link)
Thanks! BTW, I'm trying to get a group of people together to go see 300 sometime soon -- are you interested?
(Reply) (Parent) (Thread)
[User Picture]
From:h_postmortemus
Date:March 12th, 2007 06:27 pm (UTC)
(Link)
Well that's... uh... kludgy, :)
but it works. I was going to suggest ctime but I realize you want JUST files for a given date. So your solution is probably the best, actually.

Alternatively, you could use perl to step through the file tree and look at the date portion of each files stamp. That'd be relatively quick to cobble together.
(Reply) (Thread)
[User Picture]
From:crasch
Date:March 12th, 2007 06:37 pm (UTC)
(Link)
Thanks!
(Reply) (Parent) (Thread)