--- title: "list-objects" slug: "cli-objectstorage-api-level-list-objects" updated: 2026-10-08T09:51:15Z published: 2026-10-08T09:51:15Z canonical: "cli.ncloud-docs.com/cli-objectstorage-api-level-list-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. # list-objects Classic/VPC環境で利用できます。 バケットに保存されているオブジェクトリストを照会します。 ## 構文 `list-objects`構文は次の通りです。 ``` aws s3api list-objects \ --bucket \ [--delimiter ] \ [--prefix ] \ [--starting-token ] \ [--page-size ] \ [--max-items ] \ --endpoint-url ``` ## オプション `list-objects`の実行時に指定できるオプションについて説明します。 ### 必須オプション `list-objects`の必須オプションです。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--bucket` | String | Required | バケット名 | ### 任意オプション `list-objects`の任意オプションです。指定しない場合、オプションにはデフォルト値が適用されます。 | オプション | タイプ | 必須の有無 | 説明 | | --- | --- | --- | --- | | `--delimiter` | String | Optional | オブジェクトをグループ化するための区切り文字 - Prefixと Delimiterの間にあるオブジェクトを1つにグループ化 | | `--prefix` | String | Optional | 照会する Prefix | | `--starting-token` | String | Optional | 照会を開始する位置 | | `--page-size` | Integer | Optional | ページごとの項目数 - `1`~`1000` | | `--max-items` | Integer | Optional | 出力に含める項目の総数 | ### 共通オプション `aws`コマンドで共通して使用するオプションについては、[Object Storageのオプション](/docs/ja/guide-objectstorage#%EC%98%B5%EC%85%98)をご参照ください。 ## 例 オブジェクトリストの照会リクエストが成功すると、各オブジェクトの識別情報とサイズが返されます。 ### コマンド コマンドの例は次の通りです。 ``` aws s3api list-objects --bucket my-test-bucket \ --endpoint-url=https://kr.object.ncloudstorage.com ``` 接頭辞でオブジェクトを絞り込むコマンドの例は次の通りです。 ``` aws s3api list-objects --bucket my-test-bucket \ --prefix docs/ \ --endpoint-url=https://kr.object.ncloudstorage.com ``` 一度に照会できる件数を制限するコマンドの例は次の通りです。 ``` aws s3api list-objects --bucket my-test-bucket \ --max-items 2 \ --page-size 2 \ --endpoint-url=https://kr.object.ncloudstorage.com ``` 前回のレスポンスの`NextToken`を使って次のページを照会するコマンドの例は次の通りです。 ``` aws s3api list-objects --bucket my-test-bucket \ --max-items 2 \ --page-size 2 \ --starting-token eyJNYXJrZXIiOiAiaW1nL2ltYWdlLnBuZyJ9 \ --endpoint-url=https://kr.object.ncloudstorage.com ``` ### 出力 出力の例は次の通りです。 ``` { "Contents": [ { "Key": "docs/report.txt", "LastModified": "2026-09-02T05:33:23.884Z", "ETag": "\"2732fae1c46437ca8a558987ed1c1229\"", "Size": 41, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "img/image.png", "LastModified": "2026-09-02T06:39:50.488Z", "ETag": "\"2cd8bde463f5d82aae0f0cec061d6b8f\"", "Size": 70, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "large.bin", "LastModified": "2026-09-02T06:41:01.883Z", "ETag": "\"57325bca2c5c2cb6adf5aa9a66fb4e2d\"", "Size": 5242880, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "notes.txt", "LastModified": "2026-09-02T05:33:24.692Z", "ETag": "\"cc87f4af4dc404e7dd08a9309df6a374\"", "Size": 24, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "sample.txt", "LastModified": "2026-09-02T05:33:23.549Z", "ETag": "\"d48c6f4176cc2713372e2a605811ec19\"", "Size": 46, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } } ], "RequestCharged": null } ``` 接頭辞で絞り込んだ出力の例は次の通りです。 ``` { "Contents": [ { "Key": "docs/report.txt", "LastModified": "2026-09-02T05:33:23.884Z", "ETag": "\"2732fae1c46437ca8a558987ed1c1229\"", "Size": 41, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } } ], "RequestCharged": null } ``` 一度に照会できる件数を制限した出力の例は次の通りです。次のページがある場合は、`NextToken`が併せて返されます。 ``` { "Contents": [ { "Key": "docs/report.txt", "LastModified": "2026-09-02T05:33:23.884Z", "ETag": "\"2732fae1c46437ca8a558987ed1c1229\"", "Size": 41, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "img/image.png", "LastModified": "2026-09-02T06:39:50.488Z", "ETag": "\"2cd8bde463f5d82aae0f0cec061d6b8f\"", "Size": 70, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } } ], "RequestCharged": null, "NextToken": "eyJNYXJrZXIiOiAiaW1nL2ltYWdlLnBuZyJ9" } ``` 次のページを照会した出力の例は次の通りです。 ``` { "Contents": [ { "Key": "large.bin", "LastModified": "2026-09-02T06:41:01.883Z", "ETag": "\"57325bca2c5c2cb6adf5aa9a66fb4e2d\"", "Size": 5242880, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } }, { "Key": "notes.txt", "LastModified": "2026-09-02T05:33:24.692Z", "ETag": "\"cc87f4af4dc404e7dd08a9309df6a374\"", "Size": 24, "StorageClass": "Standard", "Owner": { "DisplayName": "ncp-123456-0", "ID": "ncp-123456-0" } } ], "RequestCharged": null, "NextToken": "eyJNYXJrZXIiOiAibm90ZXMudHh0In0=" } ```