The find fiasco

If you want to be sure you don’t delete files you wanted to keep (like root-directory)

never use: find /my/directory * -mindepth 1 -exec  rm -r {} \;  (VERY  BAD)

if it doesn’t find any files in your given path it will try to delete the filenames expanded by ‘*’ AFTER your given path

better use: find /my/directory -name ‘*’ -mindepth 1 -exec  rm -r {} \;

Posted August 5th, 2008 in General.

Leave a response:

You must be logged in to post a comment.