title: Bucket Commands menu: main: parent: OzoneShell weight: 2

Ozone shell supports the following bucket commands.

Create

The bucket create command allows users to create a bucket.

Params:

ArgumentsComment
UriThe name of the bucket in /volume/bucket format.

{{< highlight bash >}} ozone sh bucket create /hive/jan {{< /highlight >}}

The above command will create a bucket called jan in the hive volume. Since no scheme was specified this command defaults to O3 (RPC) protocol.

Delete

The bucket delete command allows users to delete a bucket. If the bucket is not empty then this command will fail.

Params:

ArgumentsComment
UriThe name of the bucket

{{< highlight bash >}} ozone sh bucket delete /hive/jan {{< /highlight >}}

The above command will delete jan bucket if it is empty.

Info

The bucket info commands returns the information about the bucket. Params:

ArgumentsComment
UriThe name of the bucket.

{{< highlight bash >}} ozone sh bucket info /hive/jan {{< /highlight >}}

The above command will print out the information about jan bucket.

List

The bucket list command allows users to list the buckets in a volume.

Params:

ArgumentsComment
-l, --lengthMaximum number of results to return. Default: 100
-p, --prefixOptional, Only buckets that match this prefix will be returned.
-s, --startThe listing will start from key after the start key.
UriThe name of the volume.

{{< highlight bash >}} ozone sh bucket list /hive {{< /highlight >}}

This command will list all buckets on the volume hive.

Update

The bucket update command allows changing access permissions on bucket.

Params:

ArgumentsComment
--addAclOptional, Comma separated ACLs that will added to bucket.
--removeAclOptional, Comma separated list of acl to remove.
UriThe name of the bucket.

{{< highlight bash >}} ozone sh bucket update --addAcl=user:bilbo:rw /hive/jan {{< /highlight >}}

The above command gives user bilbo read/write permission to the bucket.

path

The bucket command to provide ozone mapping for s3 bucket (Created via aws cli)

{{< highlight bash >}} ozone s3 path <> {{< /highlight >}}

The above command will print VolumeName and the mapping created for s3Bucket.

You can try out these commands from the docker instance of the Alpha Cluster.