title: How to use Bash to delete unwanted files/folders
body: <p>I'm trying to utilize a bash script to delete some unwanted files with the same name in different directories, eg: text1.txt exists in multiple directories and I wish to remove it in every directory it exists in.</p>
  <p>I need the script to delete the unwanted files and then also delete the directory in which that filename 'text1.txt' exists, so if it exists in a folder named 'TextFiles' I need that folder directory to be deleted.</p>
  <p>This is my current code I'm working on:</p>
  <pre><code>for files in &quot;/*&quot;
  do 
  rm file.1txt file2.txt file3.txt
  </code></pre>
  <p>I'm a bit curious about whether the &quot;/*&quot; will look into all directories and whether the 'do' is working to remove the files stated.</p>
  <p>Also, after utilising the 'rm' to remove specific files how do I delete the directory it exists in.</p>
  <p>Many thanks!</p>