Bash: find most recently modified files

Needing to find the most recently modified files in a directory is a pretty common need.  Luckily the find utility has flags to easily explore a directory recursively and list recently modified files.

If you want to find modified files within ‘N’ days ago from the current directory.

# files within the last 24 hours (1 day)
find . -mtime -1

# files within the last 3 days
find . -mtime -3

And if you need a bit more granularity, you can specify this as minutes also.  Use commands like below to find files modified within the last ‘N’ minutes.

# within last hour
find . -mmin +60

# within last 12 hours
find . -mmin +720

REFERENCES

find man page

baeldung, find recently changed files

NOTES

limit finds to files only

find . -type f -mmin +60

limits find to immediate directories (not recursive)

find . -maxdepth 1 -type d