--- title: "rm" slug: "cli-objectstorage-high-level-rm" updated: 2026-10-08T09:50:26Z published: 2026-10-08T09:50:26Z canonical: "cli.ncloud-docs.com/cli-objectstorage-high-level-rm" --- > ## 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. # rm Classic/VPC環境で利用できます。 Object Storageに保存されているオブジェクトを削除します。 ## 構文 `rm`構文は次の通りです。 ``` aws s3 rm \ \ [--dryrun] \ [--quiet] \ [--include ] \ [--exclude ] \ [--recursive] \ [--only-show-errors] \ [--page-size ] \ --endpoint-url ``` ## オプション `rm`の実行時に指定できるオプションについて説明します。 ### 必須オプション `rm`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `<s3-uri>` | String | Required | オブジェクトの S3 URI - `s3://{bucket_name}/{object_name}`形式 | ### 任意オプション `rm`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--dryrun` | Boolean | Optional | コマンドを実行せずに結果だけを確認 | | `--quiet` | Boolean | Optional | レスポンス結果を表示しない | | `--include` | String | Optional | 指定したパターンと一致するオブジェクトのみがコマンドに含める - 指定した順序で適用 | | `--exclude` | String | Optional | 指定したパターンと一致するオブジェクトをコマンドから除外 - 指定した順序で適用 | | `--recursive` | Boolean | Optional | 指定したパスの配下のオブジェクトまで削除 | | `--only-show-errors` | Boolean | Optional | エラーのみ表示し、その他のレスポンス値は表示しない | | `--page-size` | Integer | Optional | ページごとの項目数 - `1`~`1000` | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Object Storageのオプション](/docs/ja/guide-objectstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 コマンドを実行すると、削除したオブジェクトのパスが出力されます。 ### コマンド 1つのオブジェクトを削除するコマンドの例は次の通りです。 ``` aws s3 rm s3://my-test-bucket/sample.txt \ --endpoint-url=https://kr.object.ncloudstorage.com ``` ディレクトリ内のすべてのオブジェクトを削除するコマンドの例は次の通りです。 ``` aws s3 rm s3://my-test-bucket/docs/ \ --recursive \ --endpoint-url=https://kr.object.ncloudstorage.com ``` ### 出力 1つのオブジェクトを削除する出力の例は次の通りです。 ``` delete: s3://my-test-bucket/sample.txt ``` ディレクトリ内のすべてのオブジェクトを削除する出力の例は次の通りです。 ``` delete: s3://my-test-bucket/docs/report.txt ```