Removing directories with spaces with bash
I am using the following command to delete all ".dummy" directories in the "Test Folder":
rm -rf `find "Test Folder" -type d -name .dummy`
However, this does not work, as it expands to, say:
rm -rf Test Folder/.dummy
Since the space is not escaped, this fails.
I have also tried something like this:
find "Test Folder" -type d -name .dummy -exec rm -rf {} \;
It works, but it throws an annoying error:
find: Test Folder/.dummy: No such file or directory
Is there a way to make any solution successful?
+1
source to share