title: finding files and moving their folders
body: <p>I have a huge number of text files, organized in a big folder tree, on Debian Linux. What I need is to find all text files having a specific name pattern and then move the containing folder to a destination.</p>
  
  <p>Example:</p>
  
  <pre><code>/home/spenx/src/a12/a1a22.txt
  /home/spenx/src/a12/a1a51.txt
  /home/spenx/src/a12/a1b61.txt
  /home/spenx/src/a12/a1x71.txt
  
  /home/spenx/src/a167/a1a22.txt
  /home/spenx/src/a167/a1a51.txt
  /home/spenx/src/a167/a1b61.txt
  /home/spenx/src/a167/a1x71.txt
  </code></pre>
  
  <p>The commands:</p>
  
  <pre><code>find /home/spenx/src -name "a1a2*txt"
  mv /home/spenx/src/a12 /home/spenx/dst
  mv /home/spenx/src/a167 /home/spenx/dst
  </code></pre>
  
  <p>The result:</p>
  
  <pre><code>/home/spenx/dst/a12/a1a22.txt
  /home/spenx/dst/a167/a1a22.txt
  </code></pre>
  
  <p>Thank you for your help.</p>
  
  <p>SK</p>