When a bucket contains a large number of objects, use prefix search to quickly locate objects and directories without browsing the entire bucket.
How prefix search works
A prefix is a string that matches the beginning of an object name. When you enter a prefix, OSS returns all objects and directories at the current directory level whose names start with that string — similar to filtering files by name in a folder.
Two constraints apply:
Case-sensitive: The prefix
ExamplematchesExampleFile.jpgbut notexampleFile.jpg.Current level only: Only objects and directories directly in the searched directory are returned. Contents inside subdirectories are not included.
Flat search vs. recursive listing
Prefix search covers only the current directory level. If you need to list all objects across all subdirectory levels, use one of the following approaches instead:
| Approach | Method |
|---|---|
| API | GetBucket (ListObjects) operation |
| CLI | �PH1� command of ossutil |
Limits
| Constraint | Detail |
|---|---|
| Match type | Prefix only — matches the beginning of the object name |
| Case sensitivity | Case-sensitive |
| Prefix characters | Cannot contain a forward slash (/) |
| Search scope | Current directory level only (non-recursive) |
Search for objects in the OSS console
Log on to the OSS console.
In the left-side navigation pane, click Buckets. On the Buckets page, find and click the target bucket.
In the left-side navigation tree, choose Object Management > Objects.
Search for objects: OSS returns all objects and directories at the current level whose names start with the specified prefix.
In the root directory: Enter the prefix in the search box and press Enter, or click the
icon.In a subdirectory: Click the directory name to navigate into it, then enter the prefix in the search box and press Enter, or click the
icon.
Examples
Root directory search
TestBucket contains:
TestBucket/
├── Examplesrcfolder1/
│ ├── test.txt
│ └── abc.jpg
├── Exampledestfolder.png
└── example.txtSearching with prefix Example returns:
| Result | Reason |
|---|---|
Examplesrcfolder1 | Name starts with Example |
Exampledestfolder.png | Name starts with Example |
Not returned: example.txt (lowercase e), and files inside Examplesrcfolder1 (outside current level scope).
Subdirectory search
Examplesrcfolder1 contains:
Examplesrcfolder1/
├── Projectfolder/
│ ├── a.txt
│ └── b.txt
├── ProjectA.jpg
├── ProjectB.doc
└── projectC.docSearching with prefix Project returns:
| Result | Reason |
|---|---|
Projectfolder | Name starts with Project |
ProjectA.jpg | Name starts with Project |
ProjectB.doc | Name starts with Project |
Not returned: projectC.doc (lowercase p), and files inside Projectfolder (outside current level scope).
Search for objects using ossbrowser
What's next
To recursively list objects across directories, use the GetBucket (ListObjects) API operation or the �PH1� command of ossutil.