I need to move files based on a year. I used the find
command
find /media/WD/backup/osool/olddata/ -mtime +470 -exec ls -lrth {} \;|sort -k6
but for this command to successfully execute i need to know the exact mtime
now 470 is just a guess. Means if I can give the year 2012 it gives me files only related to 2012.
So i need advice on how to
Find files based on year e.g 2012 and move them to other directory.
OS release 5.2
FIND version
GNU find version 4.2.27
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX
-exec ls ... \;
instead of-exec ... +
? Is your find too old for that? In that casefind ... -print0 | xargs -0 ls...
would be much faster.