find, unexpected message
by kaz2100 from LinuxQuestions.org on (#5QK6G)
Hya
I cannot figure out why I am getting this error. dir2del is deleted, as I intend.Code:>mkdir dir2del
>find . -type d -name dir2del -print
./dir2del
>find . -type d -name dir2del -exec rm {} \;
rm: cannot remove './dir2del': Is a directory
>find . -type d -name dir2del -exec rm -r {} \;
find: ./dir2del': No such file or directoryI do not think I should get "No such...". I understand that -exec clause is interpreted as "rm -r dir2del", thus "rm dir2del" results in error.
rm is aliased to "rm -i", but I think it is irrelevant. This also happens when dir2del contains file/dir.
So far, I am unable to locate reason(s) in "man rm", "info rm"...
Does any expert know why?
I cannot figure out why I am getting this error. dir2del is deleted, as I intend.Code:>mkdir dir2del
>find . -type d -name dir2del -print
./dir2del
>find . -type d -name dir2del -exec rm {} \;
rm: cannot remove './dir2del': Is a directory
>find . -type d -name dir2del -exec rm -r {} \;
find: ./dir2del': No such file or directoryI do not think I should get "No such...". I understand that -exec clause is interpreted as "rm -r dir2del", thus "rm dir2del" results in error.
rm is aliased to "rm -i", but I think it is irrelevant. This also happens when dir2del contains file/dir.
So far, I am unable to locate reason(s) in "man rm", "info rm"...
Does any expert know why?