title: copying files between s3 buckets without folders amazon aws cli
body: <p>I'm looking through the documentation of aws cli and I cannot find the way to copy the only files in some directory structure to other bucket with "flattened" structure(I want one directory and all files inside of it).</p>
  
  <p>for example </p>
  
  <pre><code>/a/b/c/1.pg
  /a/2.jpg
  /a/b/3.jpg
  </code></pre>
  
  <p>i would want to have in different bucket:</p>
  
  <pre><code>/x/1.jpg
  /x/2.jpg
  /x/3.jpg
  </code></pre>
  
  <p>Am I missing something or is it impossible?
  Do you have an idea how could I do that?</p>