Deleting folders recursively

Many a times we need to delete a particular folder which is present in every subfolder of the parent directory. One such situation is the subversion’s working copy. The working copy of project which is in subversion contains .svn hidden folders. When moving the working copy to the webroot, we generally want to delete all the .svn folders as they take a lot of space.

Directories can be deleted recursively very easily in linux. To do so first go to the parent directory and then issue rm -rf `find . -type d -name .svn` command. This will delete all .svn folders from the parent as well as sub-directories. Replace .svn from the command as per your needs.

Share
 

Comments: 3

Leave a reply »

 
  • it’s really usefull.

     
     
     
  • Thanks Abbas. This was very helpful.

     
     
     
  • Navrang

    Nice.. Its working fine.

     
     
     
  • Leave a Reply
     
    Your gravatar
    Your Name