View options

更新时间:
复制 MD 格式

Run ossutil -h to list all supported command-line options.

Note

Starting from ossutil V1.6.16, you can use `ossutil` as the binary name in the command line. You do not need to change the binary name based on your operating system. If you use a version of ossutil earlier than 1.6.16, you must change the binary name to match your operating system. For more information, see Command reference for ossutil.

Command format

ossutil -h

To view options for a specific command, run ossutil help [command], for example, ossutil help cp.

Common options

Most ossutil commands support the following options:

Option

Description

-c, --config-file

The path to the ossutil configuration file, read at startup. To manage buckets across multiple accounts, create separate configuration files and use -c to specify the one to use.

-e, --endpoint

The endpoint of the bucket. To manage buckets across multiple regions, specify the corresponding endpoint. Regions and Endpoints.

-i, --access-key-id

The AccessKey ID for OSS access. Specify this option when managing buckets across multiple accounts.

-k, --access-key-secret

The AccessKey secret for OSS access. Specify this option when managing buckets across multiple accounts.

-p, --password

Prompts you to enter the AccessKey secret from the keyboard. The entered value overrides any AccessKey secret configured elsewhere.

--loglevel

Generates an ossutil.log file in the current working directory. No log file is generated by default.

Valid values:

  • info: Logs ossutil operation records.

    ossutil [command] --loglevel=info
  • debug: Outputs HTTP stream logs and the original signature string for troubleshooting.

    ossutil [command] --loglevel=debug

--proxy-host, --proxy-user, --proxy-pwd

Proxy configuration options:

  • --proxy-host: The URL of the proxy server. HTTP, HTTPS, and SOCKS5 are supported.

  • --proxy-user: The username for the proxy server. The default value is empty.

  • --proxy-pwd: The password for the proxy server. The default value is empty.

After configuration, ossutil routes traffic through the proxy.

ossutil ls oss://bucket1 --proxy-host http://47.88.**.**:3128 --proxy-user test --proxy-pwd test

--mode

The type of credential. Valid values:

  • AK: Access OSS using an AccessKey ID and an AccessKey secret.

  • StsToken: Access OSS using a Security Token Service (STS) token.

  • RamRoleArn: Access OSS using the AssumeRole operation of a RAM user.

  • EcsRamRole: Implement passwordless access on an ECS instance using a RAM role for the ECS instance.

If omitted, the default authentication logic applies.

--ecs-role-name

The name of the RAM role in EcsRamRole authentication mode.

--token-timeout

The validity period of the temporary access credential in RamRoleArn mode. Unit: seconds. Default: 3600.

--ram-role-arn

The Alibaba Cloud Resource Name (ARN) of the RAM role in RamRoleArn authentication mode.

--role-session-name

The session name in RamRoleArn authentication mode.

--read-timeout

The client read timeout. Unit: seconds. Default: 1200.

--connect-timeout

The client connection timeout. Unit: seconds. Default: 120.

--sts-region

The STS service region, for example, cn-hangzhou. Supported regions are listed in Endpoints.

Default STS endpoint in RamRoleArn mode: sts.aliyuncs.com.

--skip-verify-cert

Skips the verification of the server-side digital certificate.

--ua

Appends a custom value to the User-Agent HTTP request header. Use with --loglevel debug to view the full User-Agent in logs.

--sign-version

The version of the signature algorithm. Set the parameter to v4. If you use OSS on CloudBox, this parameter is required.

--region

The region in which the OSS on CloudBox bucket is located. If you use OSS on CloudBox, this parameter is required.

--cloudbox-id

The ID of the cloud box. If you use OSS on CloudBox, this parameter is required.

Other options

ossutil commands also support the following options:

Option Name

Description

-s, --short-format

Displays results in short format. Default: long format.

--bigfile-threshold

The file size threshold for resumable upload. Unit: bytes. Default: 100 MB. Range: 0 to 9223372036854775807.

--acl

Configures the access control list (ACL).

--range

Specifies a zero-based byte range to download from a file.

  • You can specify a range. For example, 3-9 indicates the 3rd to the 9th byte, inclusive.

  • You can specify a starting point, such as 3-, to download from byte 3 to the end of the file, inclusive.

  • You can specify the end position. For example, -9 specifies the range from byte 0 to byte 9.

--all-versions

Specifies all versions of an object.

--type

The data validation method. Valid values:

  • crc64 (default): Performs a 64-bit cyclic redundancy check (CRC64).

  • md5: Performs MD5 validation.

-v, --version

Displays the version of ossutil and exits.

-u, --update

Performs an update operation.

--origin

The value of the origin field in the HTTP request header.

--upmode

The upload mode used in the probe command. Valid values:

  • normal (default): Simple upload.

  • append: Append upload.

  • multipart: Multipart upload.

--sse-algorithm

The server-side encryption algorithm for the bucket. Valid values:

  • KMS: Uses a Key Management Service (KMS) managed key for encryption and decryption, which is SSE-KMS.

  • AES256: Uses an OSS managed key for encryption and decryption, which is SSE-OSS.

--include

Lists objects that meet the specified conditions. For example, *.jpg lists all files in the JPG format.

The --include and --exclude options.

--exclude

Lists objects that do not meet the specified conditions. For example, *.txt lists all files that are not in the TXT format.

The --include and --exclude options.

-r, --recursive

Recursively operates on all matching objects in the bucket. Without this option, only the specified object is affected.

--addr

Specifies a network address for connectivity testing via ping.

Default value: www.aliyun.com

--kms-masterkey-id

The ID of the customer master key (CMK) in KMS.

--version-id

The version ID of the object.

--version-id-marker

Lists object versions with IDs alphabetically after the specified marker. Requires versioning to be enabled.

-m, --multipart

Specifies that the operation applies to incomplete multipart upload events in the bucket.

-d, --directory

Returns only the files and subdirectories in the current directory.

--payer

The request payer. Set to requester for pay-by-requester mode.

--maxupspeed

The maximum upload speed. Unit: KB/s. Default: 0 (no limit).

--maxdownspeed

The maximum download speed. Unit: KB/s. Default: 0 (no limit).

--retry-times

The number of retries after an error. Default: 10. Range: 1 to 500.

Note

Retries occur immediately after an error.

--download

Probes network connectivity by downloading an object from the destination bucket using the file URL.

-j, --jobs

The number of concurrent tasks for multi-file operations. Default: 3. Range: 1 to 10000.

-a, --all-type

Specifies that the operation applies to objects and incomplete multipart upload events in the bucket.

--disable-empty-referer

Specifies that the Referer field cannot be empty.

--method

The HTTP request method. Valid values include PUT, GET, and DELETE.

--output-dir

The output directory for report files, such as batch copy failure reports from the cp command.

Default: the ossutil_output directory in the current directory.

--meta

Sets object metadata. Format: Cache-Control:no-cache#Content-Encoding:gzip.

--object

Specifies the file name in the probe command.

--end-time

A UNIX timestamp. If you use this option, objects last modified later than the specified time are ignored.

--limited-num

The maximum number of results to return.

-L, --language

Sets the language for ossutil. Valid values:

  • CH (default): Chinese. If you set the language to CH, make sure your system encoding is UTF-8.

  • EN: English.

--delete

Deletes a bucket, object, or fragment.

-b, --bucket

Use this option only when you delete a bucket.

--disable-crc64

Disables CRC64 validation. By default, ossutil enables CRC64 validation for data transfer.

--upload

Probes network connectivity by uploading a local file to the destination bucket.

--part-size

The part size. Unit: bytes. By default, ossutil calculates the part size based on file size. Range: 1 to 9223372036854775807.

--timeout

The signed URL timeout. Unit: seconds. Default: 60. Range: 0 to 9223372036854775807.

--checkpoint-dir

The directory for resumable upload/download checkpoint data. On failure, ossutil creates a .ossutil_checkpoint directory that is deleted after the operation succeeds. Ensure the specified directory is deletable.

--url

The file URL.

--marker

Lists buckets, objects, or parts whose names are alphabetically after the specified marker.

-f, --force

Forces the operation without a confirmation prompt.

--snapshot-path

The directory for snapshot data used in incremental uploads and downloads.

  • --snapshot-path accelerates incremental transfers of large file sets when no other user has modified the corresponding OSS objects between operations. Not supported for copy operations.

  • --snapshot-path records the `lastModifiedTime` of successfully transferred files and skips unchanged files in subsequent runs. If other users may modify OSS objects, use --update instead.

  • Snapshot data is not deleted automatically. Clear the snapshot path when no longer needed.

  • This option adds I/O overhead. For small file sets or shared objects, use --update instead.

  • --update and --snapshot-path can be combined. ossutil checks the snapshot first, then falls back to --update.

--start-time

A UNIX timestamp. If you use this option, objects last modified earlier than the specified time are ignored.

--storage-class

The storage class. Valid values:

  • Standard (default): For frequently accessed data.

  • IA: Infrequent Access. For data accessed once or twice a month. Minimum storage: 30 days. Minimum billable size: 64 KB. Real-time access with data retrieval fees.

  • Archive: Long-term data archival. Minimum storage: 60 days. Minimum billable size: 64 KB. Requires restoration (~1 minute) before access. Data retrieval fees apply.

  • ColdArchive: Extremely cold data requiring long-term storage. Minimum storage: 180 days. Minimum billable size: 64 KB. Requires restoration before access; time varies by data size and restoration mode. Data retrieval fees apply.

-t, --sts-token

The STS token for temporary credential access. Required only with STS credentials and overrides the configuration file setting. Temporary access credentials.

--parallel

The number of concurrent tasks for single-file operations. Range: 1 to 10000. Default: determined by operation type and file size.

--partition-download

Specifies a partition for parallel downloads. Format: partition_number:total_partitions. For example, 1:5 downloads partition 1 of 5. Partition numbers are 1-based. Multiple ossutil instances can download different partitions in parallel.

--bucketname

The bucket name.

--encoding-type

URL-encodes the object key after oss://bucket_name. Valid value: url. If omitted, the key is not encoded.

--origin

The Origin HTTP request header value, used to identify cross-origin requests.

--acr-method

The value of the Access-Control-Request-Method HTTP request header. Valid values are GET, PUT, POST, DELETE, and HEAD.

--acr-headers

The Access-Control-Request-Headers value for CORS preflight requests. Separate multiple headers with commas and enclose in double quotes, for example, --acr-headers "header1,header2,header3".

--upload-id-marker

Lists parts whose upload IDs are alphabetically after the specified marker.

-h, --help

Displays help information.

--trafic-limit

The HTTP speed limit for the sign command. Unit: bit/s.

Default: 0 (no limit).

Range: 819200 to 838860800 (100 KB/s to 100 MB/s).

--local-host

The local IP address for OSS access in the cp command.

--enable-symlink-dir

Uploads linked subdirectories (skipped by default). Use the probe command to detect circular symlinks.

--only-current-dir

Processes only files in the current directory, ignoring subdirectories.

--disable-dir-object

Skips creating directory objects during upload. The directory structure remains visible in the console but disappears when all files within it are deleted.

--probe-item

The probe target. Valid values:

  • upload-speed: Probes the upload bandwidth.

  • download-speed: Probes the download bandwidth.

  • cycle-symlink: Probes whether there are infinite loop link files or directories in the local file directory.

--redundancy-type

The data redundancy type of the bucket. Valid values:

  • LRS (default): Locally redundant storage (LRS) stores your data redundantly on different storage devices in the same zone. It ensures data durability and availability even if two storage devices are concurrently damaged.

  • ZRS: Zone-redundant storage (ZRS) uses a multi-zone data redundancy mechanism to store your data redundantly across multiple zones in the same region. It ensures data availability even if a zone becomes unavailable.

--disable-encode-slash

Does not encode the forward slash (/) in the URL.

--disable-all-symlink

Ignores all symbolic link subfiles and symbolic link subdirectories during upload.

--tagging

Sets object tags during upload or copy. Format: "abc=1&bcd=2&...".

--disable-ignore-error

Terminates immediately on error instead of continuing batch operations.

--block-size

The unit for object sizes in output. Valid values: KB, MB, GB, or TB. Default: bytes.

Important

This option is available only in ossutil 1.7.3 and later.

The --include and --exclude options

Rule application for multiple options

Rules can contain multiple include and exclude conditions, evaluated left to right. For example, given a file named test.txt:

  • Rule 1: --include "*test*" --exclude "*.txt" . The --include "*test*" rule matches test.txt. Then, the --exclude "*.txt" rule is applied. Because the filename test.txt contains .txt, the file is excluded. Therefore, the final result is that test.txt is excluded.

  • Rule 2: --exclude "*.txt" --include "*test*". The --exclude "*.txt" rule excludes test.txt. Then, the --include "*test*" rule is applied. Because the filename contains test, test.txt is included. The final result is that test.txt is included.

  • Rule 3: --include "*test*" --exclude "*.txt" --include "te?t.txt" . When the rule matches --include "*test*", test.txt is included. When the rule continues to match --exclude "*.txt", test.txt is excluded because its name contains .txt. When the rule finally matches --include "te?t.txt", test.txt is included. The final result is that test.txt is included.

Supported formats

  • Asterisk (*) wildcard character: Matches any sequence of characters. For example, *.txt matches all files in the TXT format.

  • Question mark (?) wildcard character: Matches any single character. For example, abc?.jpg matches all JPG files whose names are abc followed by any single character, such as abc1.jpg.

  • [sequence]: Matches any character in the sequence. For example, abc[1-5].jpg matches files from abc1.jpg to abc5.jpg.

  • [!sequence]: Matches any character not in the sequence. For example, abc[!0-7].jpg matches files other than abc0.jpg to abc7.jpg.

Limits

Directory formats are not supported in conditions. For example, if you run ossutil cp oss://examplebucket/destfolder/ localfolder/ --include dir/, the error --include or --exclude does not support format containing dir info is reported.