Read more

Find files modified since a given timestamp

Arne Hartherz
September 14, 2010Software engineer at makandra GmbH

If you need to find all files inside a directory that were modified in the last 24 hours you can do this:

find . -mtime 1
Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

You can also refer to another file's timestamp like this:

find . -cnewer other_file

This can be used to check against a specific timestamp, too. This is how you check for all files modified today (since 00:00):

touch -t `date +%m%d0000` /tmp/$$
find . -cnewer /tmp/$$

Note that $$ returns the current bash's PID so you will get some file like /tmp/12345 that stays the same for the current shell. This allows you to check against this file again without conflicting with other users.

Posted by Arne Hartherz to makandra dev (2010-09-14 10:44)