title: Bash copy all directory with content that matches a pattern
body: <p>Is there some way to copy the directories including the contents using bash script. For example </p>
  
  <pre><code>// Suppose there are many directory inside Test in c as,
     /media/test/
          -- en_US
                  -- file1
                  -- file 2 
          -- de_DE 
                 -- file 1
                 -- SUB-dir1
                    -- sub file 1
                 -- file 2
                 .....
                 .....
          -- Test 1
                --  testfile1
                -- folder
                     --- more 1  
           ............
  
  NoW i want to copy all the directories (including sub-directory and files)
  to another location which matches the pattern.
  --&gt; for example , in above case I want the directories en_US and de_DE to be copied in another
  location including sub-directories and files. 
  </code></pre>
  
  <p>So Far I have done/ find out :</p>
  
  <p>1) Needed Pattern as , <code>/b/w{2}_/w{2}/b</code></p>
  
  <p>2) I can list all the directories as , </p>
  
  <pre><code>$MYDIR="/media/test/"
  DIRS=`ls -l $MYDIR | egrep '^d' | awk '{print $10}'`
  for DIR in $DIRS
  do
  echo  ${DIR}
  done
  </code></pre>
  
  <p>Now I need help in combining these together so that the script can copy all the directory(including sub contents) that matches the pattern to another location. </p>
  
  <p>Thanks in advance.</p>