I’ve found similar questions being answered, where the find command encounters errors deleting files. However, the most similar question with an answer on Stack Exchange is regarding the find -type d -exec rmdir {} ;
command. People have recommended using the find
command with -delete
instead because the -delete
option implies -depth
, which has the find
command use depth-first search to delete files.
That makes sense to me, but I am using the command people recommend find . -type d -empty -mtime +7 -delete
to delete empty directories older than 7 days old. Yet, I still encounter the error No such file or directory
.
Interestingly, when I go to the directories that do not exist, I cannot find them. Is it deleting the directories despite the error?