--- title: "cp" slug: "cli-objectstorage-high-level-cp" updated: 2026-10-08T09:50:30Z published: 2026-10-08T09:50:30Z canonical: "cli.ncloud-docs.com/cli-objectstorage-high-level-cp" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # cp Classic/VPC環境で利用できます。 バケットにオブジェクトをアップロードしたり、既にアップロードしたオブジェクトをローカルにダウンロードまたは別の場所にコピーしたりします。 ## 構文 `cp`構文は次の通りです。 ``` aws s3 cp \ \ \ [--dryrun] \ [--quiet] \ [--include ] \ [--exclude ] \ [--recursive] \ [--acl ] \ [--follow-symlinks | --no-follow-symlinks] \ [--no-guess-mime-type] \ [--content-type ] \ [--only-show-errors] \ [--no-progress] \ [--page-size ] \ [--metadata ] \ [--metadata-directive ] \ --endpoint-url ``` ## オプション `cp`の実行時に指定できるオプションについて説明します。 ### 必須オプション `cp`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `<source>` | String | Required | 元のパス - ローカルパスまたは`s3://{bucket_name}[/{object_name}]`形式の S3 URI | | `<destination>` | String | Required | コピー先のパス - ローカルパスまたは`s3://{bucket_name}[/{object_name}]`形式の S3 URI | ### 任意オプション `cp`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--dryrun` | Boolean | Optional | コマンドを実行せずに結果だけを確認 | | `--quiet` | Boolean | Optional | レスポンス結果を表示しない | | `--include` | String | Optional | 指定したパターンと一致するオブジェクトのみがコマンドに含める - 指定した順序で適用 | | `--exclude` | String | Optional | 指定したパターンと一致するオブジェクトをコマンドから除外 - 指定した順序で適用 | | `--recursive` | Boolean | Optional | 指定したパスの配下の項目までコピー | | `--acl` | String | Optional | オブジェクトに適用するアクセス制御リスト - `private` \| `public-read` \| `public-read-write` \| `authenticated-read` | | `--follow-symlinks`, `--no-follow-symlinks` | Boolean | Optional | シンボリックリンクが指すファイルのコンテンツをアップロードするか - デフォルト: `--follow-symlinks` - ローカルファイルシステムからオブジェクトをアップロードする場合のみ対象 | | `--no-guess-mime-type` | Boolean | Optional | アップロードするオブジェクトのコンテンツタイプの自動推測を無効化 | | `--content-type` | String | Optional | 明示的なコンテンツタイプ定義 | | `--only-show-errors` | Boolean | Optional | エラーのみ表示し、その他のレスポンス値は表示しない | | `--no-progress` | Boolean | Optional | ファイル転送の進捗率を表示しない - `--quiet`または`--only-show-errors`が指定されている場合は適用しない | | `--page-size` | Integer | Optional | ページごとの項目数 - `1`~`1000` | | `--metadata` | String | Optional | オブジェクトと併せて保存するメタデータを設定 | | `--metadata-directive` | String | Optional | コピー時のメタデータ処理方式 - `COPY`(デフォルト)\| `REPLACE` - `COPY`: 元のメタデータをコピー - `REPLACE`: 再定義 | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Object Storageのオプション](/docs/ja/guide-objectstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 リクエストが成功すると、コピーされたオブジェクトのコピー元のパスとコピー先のパスが表示されます。 ### コマンド オブジェクトをアップロードするコマンドの例は次の通りです。 ``` aws s3 cp sample.txt s3://my-test-bucket/sample.txt \ --endpoint-url=https://kr.object.ncloudstorage.com ``` オブジェクトをダウンロードするコマンドの例は次の通りです。 ``` aws s3 cp s3://my-test-bucket/sample.txt sample.txt \ --endpoint-url=https://kr.object.ncloudstorage.com ``` ディレクトリ全体をアップロードするコマンドの例は次の通りです。 ``` aws s3 cp docs s3://my-test-bucket/docs \ --recursive \ --endpoint-url=https://kr.object.ncloudstorage.com ``` ### 出力 オブジェクトをアップロードする出力の例は次の通りです。 ``` Completed 46 Bytes/46 Bytes (185 Bytes/s) with 1 file(s) remaining upload: ./sample.txt to s3://my-test-bucket/sample.txt ``` オブジェクトをダウンロードする出力の例は次の通りです。 ``` Completed 46 Bytes/46 Bytes (688 Bytes/s) with 1 file(s) remaining download: s3://my-test-bucket/sample.txt to ./sample.txt ``` ディレクトリ全体をアップロードする出力の例は次の通りです。 ``` Completed 41 Bytes/41 Bytes (468 Bytes/s) with 1 file(s) remaining upload: docs/report.txt to s3://my-test-bucket/docs/report.txt ```