By using AWS re:Post, you agree to the AWS re:Post Terms of Use

How to copy S3 file that include hash as part of the name

0

I have a couple of file in S3 example filename.38207305.tar.gz, how do I copy this file without copying all the files in a folder?

I'm using: aws s3 cp s3://bucket-name/folder-name/sub-folder-name/ . --recursive --include "*.tar.gz" How do I copy the latest modified file?

1 Answer
0

UPDATE: This will list the latest version, but is does not copy the specific file that includes hash as part of the file name.

aws s3 ls s3://bucket-name/folder-name/sub-folder-name/ --recursive | sort | tail -n 1

answered a year ago
  • Your object is called file#tar..tgz or something like that?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions