title: merge pdf files by string in filename using ubuntu terminal
body: <p>I have a large number of pdfs that need to be merged into files of 2-3 pages according to their titles. </p>
  
  <p>For example if I had the following files;</p>
  
  <pre><code>jim_contract1.pdf
  jim_contract2.pdf
  jim_contract3.pdf
  susie_contract1.pdf
  susie_contract2.pdf
  charlescontract1.pdf
  charlescontract2.pdf
  charlescontract3.pdf
  charlescontract4.pdf
  </code></pre>
  
  <p>I want to be able to write a line of code for each group to merge the files to have the result</p>
  
  <pre><code>jim_contract_merged.pdf
  susie_contract_merged.pdf
  charlescontract_merged.pdf
  </code></pre>
  
  <p>I tried to use this code:</p>
  
  <pre><code>pdftk 'find -type f -name 'jim_contract*'' cat output jim_contract_merged.pdf
  </code></pre>
  
  <p>But it only returns an error message. </p>
  
  <p>Is there a way to do this from the terminal?</p>