why does find / rm tells me it doesn't find a folder after it found it? I'm trying to remove some folders recursively:
find . -name bin -type d -exec rm -r {} \;

when I run it, I get an output like this:
find: ./Services/BinanceConnector/bin: No such file or directory
find: ./Services/BinanceLeech/bin: No such file or directory
find: ./Services/BitmexConnector/bin: No such file or directory
...

but these are folders that do exist and will get removed.
when I run the command again and the bin folders do not exist, there is nothing printed on the console.
what causes this?

Edit:
ls -ld ./Services/BinanceConnector ./Services/BinanceConnector/bin
drwxr-xr-x  18 thomas  staff  576 Oct 12 21:46 ./Services/BinanceConnector
drwxr-xr-x   3 thomas  staff   96 Oct 12 21:46 ./Services/BinanceConnector/bin
You can see why this happens if you imagine that find works this way:

make a list of all folders in the current directory

for each one named &quot;bin&quot;, run the given command

descend into each folder and start from step 1


In your case, the given command is to remove the folder. Thus when you reach step 3 and try to descend into the folder, it is already gone - giving you the &quot;No such file or directory&quot; warning.
In reality find works in a bit more complicated way, but the above is detailed enough to understand what happens here.
All in all the command will work like you want it to, but you'll get these extra warnings. You can make them go away by adding a -maxdepth 2 option to the command if you know that your directory structure always has the bin folder at that level, or you can use the -prune action to not ensure that the search does not descend into the bin folders.