mv

Prev Next

Available in Classic and VPC

Move an object stored as a local file or in Ncloud Storage to another location.

Commands

The command statement is as follows:

aws s3 mv <source> <destination> --endpoint-url <value> [--options] 

Parameter

The following describes the parameters.

Parameter Type Required Description Restrictions
--endpoint-url <value> string Y Specify the default URL for command calls. It is only available for the KR Region. See Ncloud Storage overview for call domain information.
--dryrun boolean N Only check the results of the action, but do not actually apply them. -
--quiet boolean N Response results not displayed -
--include <value> string N Set the rule to include only specified objects in commands and apply them in the specified order. -
--exclude <value> string N Set the rule to exclude specified objects from commands and apply them in the specified order. -
--follow-symlinks or --no-follow-symlinks boolean N Set whether to upload the content of symbolic links in uploaded file. Only applicable when uploading objects from the local file system
--no-guess-mime-type boolean N Disable automatic content type determination for uploaded object. -
--storage-class <value> string N Specify the storage class for storing the object. Available options
- STANDARD
- DEEP_ARCHIVE
* It stores it as Standard class by default.
--content-type <value> string N Define explicit content type. -
--cache-control <value> string N Set caching behavior. -
--content-disposition <value> string N Specify representation information for the object. -
--content-encoding <value> string N Set content encoding. -
--content-language <value> string N Set content language. -
--only-show-errors boolean N Only errors are displayed; other response values are not displayed. -
--no-progress boolean N File transfer progress not displayed Not applicable if --quite or --only-show-erros is specified
--page-size <value> integer N Specify the number of listings for each response. Up to 1000 supported
--ignore-glacier-warnings boolean N Warning not displayed regarding unsupported changes (copying, downloading, moving, etc.) to object in Deep Archive -
--metadata <value> string N Set up metadata to store with the object. -
--copy-props <value> string N Set the property values to be copied from the original object. Only applicable when copying from Ncloud Storage to Ncloud Storage
--metadata-directive <value> string N Set the x-amz-metadata-directive header for the CopyObject operation. If this option is enabled, --copy-props is disabled.
--recursive boolean N Apply command scope to subdirectories. -
--debug boolean N Use debug logging. -
--no-verify-ssl boolean N Redefine the default behavior for validating SSL certificates. -
--no-paginate boolean N Disable automatic pagination, call only the first page for results. -
--output <value> string N Specify the format of call results. Available options
- json
- text
- table
- yaml
- yaml-stream
--query <value> string N JMESPath query to use for filtering response data -
--profile <value> string N Use a specific profile in the credentials file. -
--region <value> string N Specify the Region. Only KR is supported.
--color <value> string N Set output color. Available options
- on
- off
- auto
--no-sign-request boolean N Disable credential loading. -
--ca-bundle <value> string N Specify the CA certificate to use when verifying SSL certificates. -
--cli-read-timeout <value> int N Maximum read time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--cli-connect-timeout <value> int N Maximum connection time; entering 0 changes it to a blocked status instead of a timeout. It is set to 60 seconds by default.
--no-cli-pager boolean N Disable the CLI pager for response values. -
--cli-auto-prompt boolean N Enable automatic prompting for CLI input parameters. -
--no-cli-auto-prompt boolean N Disable automatic prompting for CLI input parameters. -

Examples

This section describes an example of calling and responding to the mv command.

Move local object to Ncloud Storage

Call examples

You can move an object by specifying the path of the local file to be uploaded to Ncloud Storage and the destination bucket. The object is uploaded to the bucket and the file on your local system is deleted. The following is a call example.

aws mv 1234.png s3://bucket-a/ --endpoint-url=http://kr.ncloudstorage.com s3 

Response example

The response example is as follows:

move: ./1234.png to s3://bucket-a/1234.png        

Move all prefixes and sub-objects stored in Ncloud Storage bucket to local

Call examples

If you specify the bucket to be moved locally and the path to be stored locally in Ncloud Storage and then call the command, the objects will be stored locally and the objects stored in Ncloud Storage will be deleted. Even if all objects are moved, the buckets and folders will remain unchanged, and if version control is enabled for the bucket, a delete marker will be added to the objects moved locally. The following is a call example.

aws s3 mv s3://bucket-a ./ --recursive --endpoint-url=http://kr.ncloudstorage.com

Response example

The response example is as follows:

move: s3://bucket-a/image4.png to ./image4.png                     
move: s3://bucket-a/image5.png to ./image5.png                    
move: s3://bucket-a/img/image.png to img/image.png             
move: s3://bucket-a/1234.png to ./1234.png