title: How to list several specific files from amazon S3 quickly
body: <p>I want to check if some files are really in my s3 bucket. Using aws cli I can do it for one files with ls like</p>
  
  <pre><code>aws s3 ls s3://mybucket/file/path/file001.jpg
  </code></pre>
  
  <p>but I need to be able to do it for several files</p>
  
  <pre><code>aws s3 ls s3://mybucket/file/path/file001.jpg ls s3://mybucket/file/path/file002.jpg
  </code></pre>
  
  <p>Won't work</p>
  
  <p>nor </p>
  
  <pre><code>aws s3 ls s3://mybucket/file/path/file001.jpg s3://mybucket/file/path/file005.jpg
  </code></pre>
  
  <p>Of course </p>
  
  <pre><code>aws s3 ls s3://mybucket/file/path/file001.jpg;
  aws s3 ls s3://mybucket/file/path/file005.jpg
  </code></pre>
  
  <p>Works perfectly, but slowly. It takes about 1 sec to get one file, because it connects an close the connection each time. </p>
  
  <p>I've hundreds of files to check on a regular basis, so I need a fast way to do it. Thanks</p>
  
  <p>I'm not insisting on using ls, or passing a path, a "find" of the filenames would also do (but aws cli seems to lack find). Another tool (as long as it can be invoked with the command line), will be ok</p>
  
  <p>I don’t want to get a list of all files or have a script looking at all files and then post process. I need a way to ask s3 give me fila a,r,z in one go.</p>
  
  <p>I think s3api listobjects call should be the one but I fail at its syntax to ask several file names at once. </p>