title: what is the fastest and cost efficient way of moving objects from one s3 folder to another folder in same bucket
body: <p>I have an <strong>example</strong> bucket with demo folder containing sub-folders and files in it. 
  BucketStructure:</p>
  
  <pre><code>example/demo/*.jpeg #.jpeg files 
  example/demo/sub-folder1
  example/demo/sub-folder2
  </code></pre>
  
  <p>My objective is to move all the <code>.jpeg</code> files from <code>demo/</code> folder excluding <code>.jpeg</code> files from <code>sub-folder1</code> &amp; <code>sub-folder2</code> to a new folder <code>/example/archive-jpeg/</code>.</p>
  
  <p>Seeking help to get fastest and cost efficient way using aws-cli: using awscli v2</p>
  
  <ol>
  <li>list all <code>.jpeg</code> objects in immediate <code>/demo</code> folder and</li>
  <li>moving them to <code>/archive-jpeg</code> folder </li>
  <li>deleting the <code>.jpeg</code> from <code>/demo</code> folder after archival</li>
  </ol>
  
  <p>Thank You!</p>