title: Bash - Copy files from directory
body: <p>I have a folder which contains some folders:</p>
  
  <pre><code>main
    \_ Dir 1
    \_ Dir 2
    \_ ...
    \_ Dir 40
  </code></pre>
  
  <p>I need to open each sub-folder, copy all the files and paste them in another folder, the same folder for all this sub-folder.</p>
  
  <p>How can I do that in a smart way?</p>
  
  <p>The only thing that comes to my mind was create a list with the name of all folders and then use a simple script to open, copy and paste but I'm sure that there is a faster way than write all the names.</p>