Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy a file with spaces in its file name from one bucket to the other using AWS CLI (Dos)

I am trying to copy a file by the same My CV 2017.pdf from one AWS bucket to the other using the AWS command line. But I am getting error doing that.

I tried using My\ Cv\ 2017.pdf and 'My CV 2017.pdf', both did not work.

like image 782
Krishna Menon Avatar asked Oct 29 '17 06:10

Krishna Menon


2 Answers

Use double quotes. For example:

aws s3 cp "s3://source-bucket/My CV 2017.pdf" "s3://destination-bucket/My CV 2017.pdf"

like image 164
Khalid T. Avatar answered Nov 01 '22 18:11

Khalid T.


Using double quotes can solve the problem when you have single file to upload.

For the bulk files, try uploading directory with recursive option

aws s3 mv ../directory-with-files/ s3://bucket-name/folder-to-upload/ --recursive

like image 24
Sajan Sharma Avatar answered Nov 01 '22 16:11

Sajan Sharma