I'm trying to use the linux find
command to show me the files in my current directory that have been modified in the last 24h. To test my command, I piped it to ls
as below.
find . -maxdepth 1 -mtime -1 | xargs -I{} ls -lh {}
but this command displays all the files in my directory, some of which were modified last year. What am I missing here? I also tried -atime and -ctime options out of curiosity and got seemingly the same file list.
Many thanks for the advice!
In my case the issues was caused because I had the wrong system time on my raspberry. This was because systemd-timesyncd.service was no longer running. After:
the system time was correct again. Note that the pi needs to be connected to a network for this to work. And also, of course, past wrong file dates don't get fixed by this (duh).