All Products
Search
Document Center

Object Storage Service:mkdir

Last Updated:Mar 20, 2026

Use the mkdir command to create a directory in an Object Storage Service (OSS) bucket.

Prerequisites

Before you begin, ensure that you have:

Syntax

ossutil mkdir oss://<bucket>/<dir_name> [flags]

Brackets ([]) indicate optional parameters.

Parameters

ParameterTypeDescription
bucketstringThe name of the bucket.
dir_namestringThe name of the directory to create.
--encoding-typestringThe encoding of the directory name. Valid value: url. If not specified, the directory name is not encoded.
--request-payerstringThe payer of the traffic and request fees. Set to requester when pay-by-requester is enabled on the bucket.

For all available flags, see Command-line options.

Examples

Create a single-level directory

ossutil mkdir oss://examplebucket/dir

Create a multi-level directory

ossutil mkdir oss://examplebucket/dir1/dir2