newspaint

Documenting Problems That Were Difficult To Find The Answer To

Finding Files Between Two Dates in Linux

I found this tip at this page and it was so good I have to put it here in case the original ever disappears from the Internet.

Create two temporary files indicating the “from” time and the “to” time limits, respectively.

touch --date "2009-05-01" /tmp/from
touch --date "2009-06-04" /tmp/to

Then start your search using the -newer and -not -newer command-line flags.

find /backup -type f -newer /tmp/from -not -newer /tmp/to

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: