Recursively delete folders

Don't miss a thing. Post your questions and discussion about other uncategorized NAS features here.

Recursively delete folders

Postby dmccormack » Sat Aug 18, 2012 7:06 am

Hi

I am after spending 3 hours trying to just recursively delete some folders and I'm slowly going mad now.

I've tried different variations of the following:

Code: Select all
find . -name .svn -print0 | xargs -0 rm -rf

Code: Select all
find . -name .svn -exec 'rm -rf {}\;'

Code: Select all
rm -rf `find . -name .svn'


I wrote a script but some of the folders contain spaces, so it is also not working:
Code: Select all
find . -name ".svn" -print | while read file; do
   rm -rf $file
done


What am i doing wrong, this should not be so difficult :(
dmccormack
Starting out
 
Posts: 15
Joined: Wed Apr 27, 2011 9:13 pm
NAS Model: TS-x69 Pro

Re: Recursively delete folders

Postby dmccormack » Sat Aug 18, 2012 5:52 pm

I had to install the find command from Optware in order to get this running, but works now.
dmccormack
Starting out
 
Posts: 15
Joined: Wed Apr 27, 2011 9:13 pm
NAS Model: TS-x69 Pro


Return to Miscellaneous

Who is online

Users browsing this forum: thetadawg and 2 guests