Search for objects

Updated at:

If a bucket contains many objects, you can use OSS to quickly search for and locate them by specifying a prefix.

Limits

  • Search rules

    You can search for objects by their name prefix. The search string is case-sensitive and cannot contain a forward slash (/).

  • Search results

    When you search by prefix in a bucket's root directory or a specific folder, the results show only matching files or subfolders. You cannot view the files within the subfolders.

    Note

    If you want to recursively search for files or folders in a bucket, you can use the GetBucket (ListObjects) API or the ls command of the ossutil command-line tool.

Procedure

Use the OSS console

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the page that appears, click the name of the target bucket.

  3. In the left-side navigation pane, choose Object Management > Objects.

  4. Search for files.

    • Search for a specific file or folder in the root directory of the bucket

      Enter a prefix in the search box and press Enter or click the search icon. You can then view the files and folders in the root directory that match the prefix.

      The following example shows the search results for objects that have the prefix `Example` in the `TestBucket` bucket.

      File structure                     Specified prefix      Search results
      TestBucket                         Example               Examplesrcfolder1                          
          └── Examplesrcfolder1                                Exampledestfolder.png                           
                 ├── test.txt                                
                 ├── abc.jpg
          └── Exampledestfolder.png
          └── example.txt
    • Search for a specific file or subfolder in a target folder

      Click the target folder. Then, enter a prefix in the search box and press Enter or click the search icon. You can then view the files and subfolders in the target folder that match the prefix.

      The following example shows the search results for objects that have the prefix `Project` in the `Examplesrcfolder1` folder.

      File structure                Specified prefix       Search results
      Examplesrcfolder1           Project                Projectfolder
          └── Projectfolder                              ProjectA.jpg
                ├── a.txt                                ProjectB.doc
                ├── b.txt
          └── ProjectA.jpg
          └── ProjectB.doc
          └── projectC.doc

Use the ossbrowser GUI tool

ossbrowser supports bucket-level operations that are similar to those in the OSS console. To perform a simple upload, follow the on-screen instructions in the ossbrowser interface. For more information about how to use ossbrowser, see ossbrowser 2.0.