Buckets
In Object Storage, buckets are the basic containers for your data. They organize and control access to your objects (files). Each bucket is a flat container with no folder hierarchy, but you can use prefixes and delimiters to mimic a folder structure.
List Buckets
Listing buckets shows you all the buckets in your Object Storage account.
Usage:
mc ls s11_dus2
This command lists all buckets in your Object Storage account in the DUS2 region.
Output:
[2023-05-15 14:30:25 CEST] 0B my-first-bucket/
[2023-05-15 16:45:10 CEST] 0B my-second-bucket/
Create a Bucket
Creating a bucket is the first step to storing objects in Object Storage.
Usage:
mc mb s11_dus2/my-new-bucket
This command creates a new bucket named "my-new-bucket" in the DUS2 region.
Output:
Bucket created successfully `s11_dus2/my-new-bucket`.
View Bucket Details
You can view details about a specific bucket, including its size and the number of objects it contains.
Usage:
mc stat s11_dus2/my-bucket
This command displays statistics for the bucket named "my-bucket".
Output:
Name : my-bucket
Date : 2023-05-15 14:30:25 CEST
Size : 256 MiB
Objects : 1000
Delete a Bucket
Delete a bucket when you no longer need it. The bucket must be empty before deletion.
Usage:
mc rb s11_dus2/my-bucket
This command removes the bucket named "my-bucket". If the bucket is not empty, you'll need to use the --force flag to remove it and all its contents:
mc rb s11_dus2/my-bucket --force
Output:
Removed `s11_dus2/my-bucket` successfully.