If I use AWS CLI S3 'mv' command, what type of request is behind that?

Viewed 2060

I can't find that anywhere. If I use a command like aws s3 mv s3://bucket/ <local_pc>, what type of HTTP request is behind it? Is it GET or COPY?

3 Answers

An aws s3 mv command will issue a:

  • Copy command
  • Delete command

In your example, you are 'moving' a file from Amazon S3 to your PC. Therefore, it will be a download (GetObject) from S3 and then the object will be deleted from S3.

If you were moving from your computer to S3, then it would be a PutObject (upload) and then a delete of the local object.

If moving between two Amazon S3 buckets, it would issue a CopyObject and then a DeleteObject.

Mv is not copy. MV command is used to move the files from one location to another.

It will move a local file or S3 object to another location locally or in S3. The file will be deleted from source and copied to the target path.

If you want to copy, then command is cp.

Hope below link will help you.
https://docs.aws.amazon.com/cli/latest/reference/s3/mv.html

Related