title: How to merge files within a sub-directory and perform this function on mutliple sub-directories
body: <p>I have a directory with ~2000 sub-directories and within each sub-directory there are between 2-10 txt files. I would like to open each sub-directory and merge or concatenate the contents into a single file, thus I would have 2000 directories, each with 1 txt file. 
  I have tried to do this using unix commands, but I can't seem to get the command to execute in a specific sub-directory and then change directories and perform the function again. </p>
  
  <pre><code>find . -maxdepth 1 -name "*.faa" -exec cat {} 
  </code></pre>
  
  <p>Is there a way to turn this into a bash script and have it run over the entire directory, or should I look to something more like python to try and accomplish this task.</p>
  
  <p>Thank you and I apologize if this has been asked.</p>