You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Common examples
Deleting objects
Copy page
Download PDF
Deleting objects
This topic provides examples of how to delete objects with common tosutil commands on macOS.​
Example bucket and example objects​
The example bucket is named bucketname and contains the following objects:​
​
tos://bucketname/file1.txt​
tos://bucketname/file2.txt​
tos://bucketname/file3.txt​
tos://bucketname/file4.txt​
tos://bucketname/file5.txt​
tos://bucketname/file6.txt​
tos://bucketname/folder1/​
tos://bucketname/folder1/file7.txt​
tos://bucketname/folder2/​
tos://bucketname/folder2/file8.txt​
tos://bucketname/folder2/folder3/​
tos://bucketname/folder2/folder3/file9.txt​
​
Common examples​
The following commands illustrate various deletion scenarios based on the objects of the example bucket.​
Delete an object​
Delete the file1.txt object in the bucketname bucket​
​
./tosutil rm tos://bucketname/file1.txt​
​
Delete a folder​
Delete the folder2 folder in the bucketname bucket​
​
./tosutil rm tos://bucketname/folder2/ -r​
​
Delete objects with the specified prefix​
Delete all objects and folders within the bucketname bucket that have the folder prefix​
​
./tosutil rm tos://bucketname/folder -r​
​
warning​
This command deletes folder1/ and folder2/.​
Last updated: 2025.12.17 18:33:44