conradin
July 1st, 2011, 10:16 PM
Hi all,
I have a directory with 52,000 sub-directories. Each sub-directory has numerous files. What I need to do is search each sub-directory, and find out if any of the files are newer than june, sixth, 2006.
if any file is older than 6.6.06, I can move to the next sub-directory.
if all the files are older, I can delete them all, and that sub-directory.
So, I am looking at the find command, and think that it could do most of the work I need it to do with the command:
find -newerXY
But I cant seem to get it to work, and I haven't found any examples how to use the -newerXY option.
Does anyone have any ideas how I can get this done, or a functional code example?
I have a directory with 52,000 sub-directories. Each sub-directory has numerous files. What I need to do is search each sub-directory, and find out if any of the files are newer than june, sixth, 2006.
if any file is older than 6.6.06, I can move to the next sub-directory.
if all the files are older, I can delete them all, and that sub-directory.
So, I am looking at the find command, and think that it could do most of the work I need it to do with the command:
find -newerXY
But I cant seem to get it to work, and I haven't found any examples how to use the -newerXY option.
Does anyone have any ideas how I can get this done, or a functional code example?