How do I find all the files that were create only today and not in 24 hour period in unix/linux
+5
A:
On my Fedora 10 system, with findutils-4.4.0-1.fc10.i386
:
find <path> -daystart -ctime 0 -print
The -daystart
flag tells it to calculate from the start of today instead of from 24 hours ago.
Note however that this will actually list files created or modified in the last day. find
has no options that look at the true creation date of the file.
Alnitak
2009-04-29 06:27:49
Nor is the "true creation date" even available as information that the filesystem stores.
ephemient
2009-04-29 18:55:16
+1
A:
You can't. @Alnitak's answer is the best you can do, and will give you all the new files in the time period it's checking for, but -ctime
actually checks the modification time of the file's inode (file descriptor), and so will also catch any older files (for example) renamed in the last day.
Pete Jordan
2009-04-29 06:54:19