All Products
Search
Document Center

Object Storage Service:mkdir

Last Updated:Jul 31, 2024

To organize objects in a bucket, you can use directories. This topic describes how to use the mkdir command to create a directory in Object Storage Service (OSS).

Usage notes

Command syntax

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

Option

Type

Description

bucket

string

The name of the bucket.

dir_name

string

The directory name.

--encoding-type

string

The encoding of the input object name or file name. Valid value: url.

If you do not specify this option, the directory name is not encoded.

--request-payer

string

The payer of the traffic and request fees. If pay-by-requester is enabled, specify this parameter. Valid value: requester.

Note

For more information, 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