title: Searching Directories and Removing Folders and Files in Bash
body: <p>I have a bash script that goes into a <code>components/</code> and runs the following command:</p>
  
  <p><code>cp -R vendor/* .</code></p>
  
  <p>I then have a second command that traverses any folder, accept the vendor folder , inside the components directory lookinf got <code>.git/</code>, '.gitignore' and <code>Documentation/</code> and removes them. How ever:</p>
  
  <ul>
  <li>I don't thinks it's recursive</li>
  <li>It doesn't actually remove those files and directories either because of the top point or because of permissions (should I add a sudo)?</li>
  </ul>
  
  <p>A directory copied from vendor might look like:</p>
  
  <pre><code>something/
      child-directory/
          .git/ // -- Should be removed.
  </code></pre>
  
  <p>The command in question is:</p>
  
  <pre><code>  find -name vendor -prune -o \( -name ".git" -o -name ".gitignore" -o -name "Documentation" \) -prune -exec rm -     rf "{}" \; 2&gt; /dev/null || true  
  </code></pre>
  
  <p>Now if it is a permission error, I wont know about it because I want it to ignore any errors and continue with the script.</p>
  
  <p>Any thoughts?</p>