Find the files that have been changed in last 24 hours
To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories:
find /directory_path -mtime -1 -ls
Should be to your liking
The -
before 1
is important - it means anything changed one day or less ago.
A +
before 1
would instead mean anything changed at least one day ago, while having nothing before the 1
would have meant it was changed exacted one day ago, no more, no less.
Another, more humane way:
find /<directory> -newermt "-24 hours" -ls
or:
find /<directory> -newermt "1 day ago" -ls
or:
find /<directory> -newermt "yesterday" -ls
You can do that with
find . -mtime 0
From man find
:
[The] time since each file was last modified is divided by 24 hours and any remainder is discarded. That means that to match -mtime 0, a file will have to have a modification in the past which is less than 24 hours ago.