--- title: "rb" slug: "rb" updated: 2026-10-08T09:46:30Z published: 2026-10-08T09:46:30Z canonical: "cli.ncloud-docs.com/rb" --- > ## 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. # rb Classic/VPC環境で利用できます。 Ncloud Storageから空のバケットを削除します。 注意 削除したバケットやオブジェクトは復元できません。`--force`オプションを使用すると、バケット内のすべてのオブジェクトが削除された後にバケットが削除されます。実行前に対象のバケットをご確認ください。 ## 構文 `rb`構文は次の通りです。 ``` aws s3 rb \ \ [--force] \ --endpoint-url ``` ## オプション `rb`の実行時に指定できるオプションについて説明します。 ### 必須オプション `rb`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `<s3-uri>` | String | Required | バケットの S3 URI - `s3://{bucket_name}`形式 | ### 任意オプション `rb`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--force` | Boolean | Optional | バケット内のすべてのオブジェクトを削除した後、バケットを削除 - バージョン IDのあるオブジェクトは削除不可 | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Ncloud Storageのオプション](/docs/ja/storage-ncloudstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 コマンドを実行すると、削除したバケットの名前が出力されます。`--force`オプションを使用した場合、削除したオブジェクトのパスも併せて出力されます。 ### コマンド 空のバケットを削除するコマンドの例は次の通りです。 ``` aws s3 rb s3://my-temp-bucket \ --endpoint-url=https://kr.ncloudstorage.com ``` 空でないバケットをオブジェクトごと削除するコマンドの例は次の通りです。 ``` aws s3 rb s3://my-temp-bucket \ --force \ --endpoint-url=https://kr.ncloudstorage.com ``` ### 出力 空のバケットを削除する出力の例は次の通りです。 ``` remove_bucket: my-temp-bucket ``` 空でないバケットをオブジェクトごと削除する出力の例は次の通りです。 ``` delete: s3://my-temp-bucket/img/photo.jpg delete: s3://my-temp-bucket/docs/report.txt remove_bucket: my-temp-bucket ``` `--force`オプションを指定せずに空でないバケットを削除すると、以下のようなエラーメッセージが出力されます。 ``` remove_bucket failed: s3://my-temp-bucket An error occurred (BucketNotEmpty) when calling the DeleteBucket operation: The bucket you tried to delete is not empty. ```