--- title: "delete-objects" slug: "delete-objects" updated: 2026-10-08T09:48:26Z published: 2026-10-08T09:48:26Z canonical: "cli.ncloud-docs.com/delete-objects" --- > ## 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. # delete-objects Classic/VPC環境で利用できます。 Ncloud Storageバケットに保存されている2つ以上のオブジェクトを一括削除します。 参考 Sub Accountユーザーがこのコマンドを実行するには、Change/DeleteObjectアクションの権限が必要です。GOVERNANCEモードのリテンションをバイパスして削除する場合(`--bypass-governance-retention`)、Change/BypassGovernanceRetentionアクションの権限が追加で必要になります。 ## 構文 `delete-objects`構文は次の通りです。 ``` aws s3api delete-objects \ --bucket \ --delete \ [--bypass-governance-retention | --no-bypass-governance-retention] \ --endpoint-url ``` ## オプション `delete-objects`の実行時に指定できるオプションについて説明します。 ### 必須オプション `delete-objects`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--bucket` | String | Required | バケット名 | | `--delete` | String | Required | 削除対象のオブジェクトリスト - [構文](/docs/ja/delete-objects#delete%EA%B5%AC%EB%AC%B8)を参照 | #### `--delete`構文 - Shorthand構文 ``` Objects=[{Key=string,VersionId=string,ETag=string,LastModifiedTime=timestamp,Size=long},{Key=string,VersionId=string,ETag=string,LastModifiedTime=timestamp,Size=long}],Quiet=boolean ``` - JSON構文 ``` { "Objects": [ { "Key": "string", "VersionId": "string", "ETag": "string", "LastModifiedTime": timestamp, "Size": long } ... ], "Quiet": true|false } ``` ### 任意オプション `delete-objects`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--bypass-governance-retention` | Boolean | Optional | `GOVERNANCE`モードリテンション設定のバイパス - `GOVERNANCE`リテンションが設定されたオブジェクトバージョンを削除する際に使用 - バイパス権限が必要 | | `--no-bypass-governance-retention` | Boolean | Optional | `GOVERNANCE`モードリテンション設定をバイパスしない | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Ncloud Storageのオプション](/docs/ja/storage-ncloudstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 オブジェクトの削除リクエストが成功すると、削除された各オブジェクトの識別情報が返されます。 ### コマンド コマンドの例は次の通りです。 ``` aws s3api delete-objects --bucket my-test-bucket \ --delete '{"Objects":[{"Key":"synced/report.txt"}],"Quiet":false}' \ --endpoint-url=https://kr.ncloudstorage.com ``` ### 出力 出力の例は次の通りです。 ``` { "Deleted": [ { "Key": "synced/report.txt" } ] } ``` ## 関連コマンド 関連コマンドは次の通りです。 - [delete-object](/docs/ja/delete-object) - [put-object](/docs/ja/put-object)