[TriLUG] `find -delete` not deleting

Lance A. Brown via TriLUG trilug at trilug.org
Tue Sep 6 12:19:23 EDT 2016


TEST this before using!

Something like:

find $top_dir -mtime +7 > /tmp/delete.$$ && xargs /bin/rm -rf <
/tmp/delete.$$ && /bin/rm /tmp/delete.$$

That way you capture the list of files/directories to delete to a file,
delete them, then remove that file.  This avoids changing the mtime on
the directories.

--[Lance]


More information about the TriLUG mailing list