Searching for Object Storage Objects in a Bucket

Search for objects in an Object Storage bucket.

You can search for objects in a bucket by entering one or more characters matching the objects' name prefixes. For example, if you had 100 objects in a bucket, and 10 of them started with "test," entering "test" in the Console's Search by prefix box displays only those object with that "test" prefix. Use the prefix parameter when using the CLI or API to perform the same function. See Object Naming Using Prefixes and Hierarchies for more information on using the prefix feature with an object.

Note

Searching for an object in a bucket using any other method, such as using segments within an object's name or using wildcards ("*"), isn't supported.

    1. Open the navigation menu and click Storage. Under Object Storage & Archive Storage, click Buckets.
    2. Select the compartment from the list under List Scope. All buckets in that compartment are listed in tabular form.
    3. Click the bucket whose objects you want to list. The bucket's Details page appears.
    4. Click Objects under Resources. The Objects list appears. All objects are listed in tabular form.
    5. Enter the characters you want to search the objects for in the Search by prefix box and press Enter.

    All the objects whose name prefix matches the characters you entered appear in the Objects list. The more characters you enter that the object names must match, the smaller and more precise the number of objects returned.

    To display all the objects in the bucket, clear the Search by prefix box and press Enter.

  • Use the oci os object list command and required parameters to list the objects in a bucket. Include the prefix parameter and the prefix value the returned object names must match.

    oci os object list --bucket-name bucket_name --prefix prefix ... [OPTIONS]

    Only those objects whose names match the prefix value you included in the command are displayed in the return.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the ListObjects operation to list the objects in a bucket. Include the prefix parameter and the prefix value the returned object names must match.

    Object Storage prepends the Object Storage namespace string and bucket name to the object name when constructing a URL for use with the API:

    /n/object_storage_namespace/b/bucket/o/object_name

    The object name is everything after the /o/, which could include hierarchy levels and prefix strings.