How to find files by date on Linux



Many times I had to search for files by date of creation.

First To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:

find . -mtime -1 -print

To find all files modified in the last 24 hours (last full day) in a specific directory and its sub-directories:

find /your_directory_path -mtime -1 -print

To find modified files only (without directories and still and modified in the last 24 hours) in current directory and its sub-directories:

find . -type f -mtime -1 -print

To find modified directories only in current directory and its sub-directories:

find . -type d -mtime -1 -print

To find files modified since certain date: e.g. Find files newer than 2010/Jan/05

touch --date "2010-01-05" /tmp/foo
find . -newer /tmp/foo



Any thoughts?

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Loading more content...