Run ossutil -h to display all options supported by ossutil.
For ossutil 1.6.16 and later, use ossutil as the binary name on all operating systems. Earlier versions require an OS-specific binary name. For more information, see ossutil command reference.Command syntax
ossutil -hTo view the options for a specific command, run ossutil help [command]. For example:
ossutil help cpCommon options
The following options apply to most ossutil commands.
| Option | Description |
|---|---|
-c, --config-file | Path to the ossutil configuration file. ossutil reads this file on startup. To manage buckets across different Alibaba Cloud accounts, create multiple configuration files and specify one with this option. |
-e, --endpoint | Endpoint of the bucket. Use this option to manage buckets across regions. For more information, see Regions and endpoints. |
-i, --access-key-id | AccessKey ID for accessing Object Storage Service (OSS). Use this option to manage buckets that belong to different Alibaba Cloud accounts. |
-k, --access-key-secret | AccessKey secret for accessing OSS. Use this option to manage buckets that belong to different Alibaba Cloud accounts. |
-p, --password | AccessKey secret for accessing OSS, entered interactively from the keyboard. This value overrides the AccessKey secret configured by other methods. |
--loglevel | Log level for the ossutil.log file generated in the current working directory. Default: no log file is generated. Valid values: info -- logs operations. Example: ossutil [command] --loglevel=info. debug -- logs HTTP requests, responses, and raw signature strings for troubleshooting. Example: ossutil [command] --loglevel=debug. |
--proxy-host, --proxy-user, --proxy-pwd | Proxy server settings. Specify all three options to route ossutil traffic through a proxy. --proxy-host: proxy URL. Supports HTTP, HTTPS, and SOCKS5. --proxy-user: proxy username. Default: empty. --proxy-pwd: proxy password. Default: empty. Example: ossutil ls oss://bucket1 --proxy-host http://47.88.**:3128 --proxy-user test --proxy-pwd test |
--mode | Credential type for authentication. Valid values: AK -- AccessKey ID and AccessKey secret. StsToken -- Security Token Service (STS) token. RamRoleArn -- AssumeRole through Resource Access Management (RAM). EcsRamRole -- password-free authentication from an Elastic Compute Service (ECS) instance. Default: default authentication logic. |
--ecs-role-name | RAM role name for EcsRamRole authentication. |
--token-timeout | Validity period of the token obtained through AssumeRole in RamRoleArn authentication. Default: 3600. Unit: seconds. |
--ram-role-arn | Alibaba Cloud Resource Name (ARN) of the RAM role for RamRoleArn authentication. |
--role-session-name | Session name for RamRoleArn authentication. |
--read-timeout | Client read timeout. Default: 1200. Unit: seconds. |
--connect-timeout | Client connection timeout. Default: 120. Unit: seconds. |
--sts-region | Region for the STS endpoint. Example: cn-hangzhou. For all supported regions, see Endpoints. Default: sts.aliyuncs.com. |
--skip-verify-cert | Skips server certificate verification. |
--ua | Custom User-Agent header value. The specified value is appended to the default ossutil User-Agent string. To view the full User-Agent value, use --loglevel debug. |
Command-specific options
The following options are available for specific ossutil commands.
| Option | Description |
|---|---|
-s, --short-format | Displays items in short format. Default: long format. |
--bigfile-threshold | Object size threshold for resumable upload. Default: 104857600 (100 MB). Valid values: 0 to 9223372036854775807. Unit: bytes. |
--acl | Access control list (ACL) to apply. |
--range | Byte range of the object to download. Bytes are numbered starting from 0. Formats: 3-9 -- bytes 3 through 9 (inclusive). 3- -- byte 3 through end of object. -9 -- byte 0 through byte 9 (inclusive). |
--all-versions | Applies the operation to all versions of an object. |
--type | Algorithm for data verification. Default: crc64. Valid values: crc64, md5. |
-v, --version | Displays the ossutil version. |
-u, --update | Performs an incremental operation. |
--origin | Value of the Origin header in an HTTP request. |
--upmode | Upload method for the probe command. Default: normal. Valid values: normal -- simple upload. append -- append upload. multipart -- multipart upload. |
--sse-algorithm | Server-side encryption algorithm for the bucket. Valid values: KMS -- encryption with keys managed by Key Management Service (KMS) (SSE-KMS). AES256 -- encryption with keys managed by OSS (SSE-OSS). |
--include | Includes only objects that match the specified pattern. Example: *.jpg includes all JPG objects. See --include and --exclude pattern behavior. |
--exclude | Excludes objects that match the specified pattern. Example: *.txt excludes all TXT objects. See --include and --exclude pattern behavior. |
-r, --recursive | Performs the operation recursively on all matching objects in the bucket. Without this option, only the object specified in the URL is affected. |
--addr | Network address for connectivity checks. ossutil runs a ping to this address. Default: www.aliyun.com. |
--kms-masterkey-id | Customer master key (CMK) ID for KMS encryption. |
--version-id | Version ID of the object. |
--version-id-marker | Starting position for listing object versions. Lists versions with IDs alphabetically after this value. Requires versioning to be enabled on the bucket. |
-m, --multipart | Applies the operation to incomplete multipart upload tasks in the bucket. |
-d, --directory | Returns only objects and subdirectories in the current directory. |
--payer | Request payer. Set to requester to enable pay-by-requester mode. |
--maxupspeed | Maximum upload speed. Default: 0 (unlimited). Unit: KB/s. |
--maxdownspeed | Maximum download speed. Default: 0 (unlimited). Unit: KB/s. |
--retry-times | Number of retries when an error occurs. Default: 10. Valid values: 1 to 500. Retries are performed immediately after an error. |
--download | Checks network connectivity by downloading an object from the bucket using its URL. |
-j, --jobs | Number of concurrent tasks across multiple objects. Default: 3. Valid values: 1 to 10000. |
-a, --all-type | Applies the operation to both objects and incomplete multipart upload tasks in the bucket. |
--disable-empty-referer | Blocks requests with an empty Referer header. |
--method | HTTP request method. Valid values: PUT, GET, DELETE. |
--output-dir | Directory for output files, such as error reports generated by the cp command during batch operations. Default: ossutil_output in the current directory. |
--meta | Object metadata in [header:value#header:value...] format. Example: Cache-Control:no-cache#Content-Encoding:gzip. |
--object | Object name for the probe command. |
--end-time | Linux/UNIX timestamp. Objects with a last modified time later than this value are ignored. |
--limited-num | Maximum number of results to return. |
-L, --language | Language for ossutil output. Default: CH. Valid values: CH -- Chinese (requires UTF-8 encoding). EN -- English. |
--delete | Deletes the specified buckets, objects, or parts. |
-b, --bucket | Specifies that the delete operation targets a bucket. |
--disable-crc64 | Disables CRC-64 verification during data transfer. By default, CRC-64 is enabled. |
--upload | Checks network connectivity by uploading a local file to the bucket. |
--part-size | Part size for multipart operations. By default, ossutil calculates an appropriate size based on the object. Valid values: 1 to 9223372036854775807. Unit: bytes. |
--timeout | Validity period of a signed URL. Default: 60. Valid values: 0 to 9223372036854775807. Unit: seconds. |
--checkpoint-dir | Directory for storing checkpoint data during resumable upload, download, or copy operations. If a task fails, ossutil creates a .ossutil_checkpoint directory and saves checkpoint data there. On success, ossutil deletes the directory. If you specify a custom directory, make sure it can be deleted. |
--url | Object URL. |
--marker | Starting position for list operations. Items (buckets, objects, or parts) with names alphabetically after this value are listed. |
-f, --force | Forces the operation without prompting for confirmation. |
--snapshot-path | Directory for storing snapshots of uploaded or downloaded objects. When specified, ossutil reads snapshot data and performs incremental uploads or downloads. Usage notes: Use this option to accelerate incremental uploads or downloads of large numbers of objects. Not supported for copy operations. This option records the last modified time of objects locally. Between runs, objects in OSS must not be modified by other users. If objects may change between runs, use --update instead for incremental operations. Snapshot data is not automatically deleted. Remove outdated snapshots manually. Reading and writing snapshot data adds overhead. For small object counts or good network conditions, use --update instead. Both --update and --snapshot-path can be combined. ossutil checks snapshots first, then falls back to --update logic. |
--start-time | Linux/UNIX timestamp. Objects with a last modified time earlier than this value are ignored. |
--storage-class | Storage class of the object. Default: Standard. Valid values: Standard -- for frequently accessed data. IA -- Infrequent Access. Minimum storage: 30 days, minimum billable size: 64 KB. Supports real-time access. Data retrieval fees apply. Archive -- for long-term storage. Minimum storage: 60 days, minimum billable size: 64 KB. Requires restoration (approximately 1 minute). Data retrieval fees apply. ColdArchive -- for rarely accessed long-term storage. Minimum storage: 180 days, minimum billable size: 64 KB. Requires restoration (time varies by object size and restoration mode). Data retrieval fees apply. |
-t, --sts-token | STS token for temporary access to OSS. Required only for STS-based authentication. This value overrides the token in the configuration file. For more information, see Authorized third-party upload. |
--parallel | Number of concurrent operations on a single object. Default: auto-calculated based on operation type and object size. Valid values: 1 to 10000. |
--partition-download | Partition to download, in partition_number:total_partitions format. Example: 1:5 downloads partition 1 of 5. Partitions are numbered starting from 1, and partitioning is determined by ossutil. Use this option to split an object across multiple concurrent ossutil commands, each downloading its own partition. |
--bucketname | Bucket name. |
--encoding-type | Encoding type for the object key after oss://bucket_name. Valid value: url. Default: no encoding. |
--origin | Value of the Origin header in an HTTP request, specifying the source domain for cross-origin requests. |
--acr-method | Value of the Access-Control-Request-Method header. Valid values: GET, PUT, POST, DELETE, HEAD. |
--acr-headers | Value of the Access-Control-Request-Headers header. Specifies non-standard request headers. Separate multiple headers with commas and enclose them in double quotes. Example: --acr-headers "header1,header2,header3". |
--upload-id-marker | Starting position for listing multipart upload tasks. Lists tasks with upload IDs alphabetically after this value. |
-h, --help | Displays help information for a command. |
--trafic-limit | HTTP access speed limit for signed URLs. Default: 0 (unlimited). Valid values: 819200 to 838860800 (100 KB/s to 100 MB/s). Unit: bit/s. |
--local-host | Local IP address for ossutil to use with the cp command. |
--enable-symlink-dir | Uploads subdirectories that symbolic links point to. By default, these subdirectories are not uploaded. Use the probe command to check whether a symlinked target is also a symbolic link. |
--only-current-dir | Uploads, downloads, or copies only objects in the current directory. Ignores subdirectories and their contents. |
--disable-dir-object | Prevents generating an OSS object for uploaded directories. The directory structure is maintained in the OSS console, but deleting all objects in a directory also deletes the directory. |
--probe-item | Item to check with the probe command. Valid values: upload-speed -- checks upload bandwidth. download-speed -- checks download bandwidth. cycle-symlink -- checks whether a local symbolic link points to itself. |
--redundancy-type | Data redundancy type of the bucket. Default: LRS. Valid values: LRS -- locally redundant storage. Stores copies of each object across different devices within the same zone. ZRS -- zone-redundant storage. Stores copies across multiple zones in the same region, providing availability even if a zone becomes unavailable. |
--disable-encode-slash | Prevents encoding forward slashes (/) in URLs. |
--disable-all-symlink | Ignores all symbolic links and their target subdirectories during upload. |
--tagging | Object tags to apply during upload or copy. Example: "abc=1&bcd=2&...". |
--disable-ignore-error | Stops batch operations when an error occurs, instead of ignoring errors. |
--block-size | Unit for displaying the total object size within a bucket or directory. Valid values: KB, MB, GB, TB. Default: bytes. Important Available in ossutil 1.7.3 and later. |
--include and --exclude pattern behavior
Left-to-right evaluation
A rule can contain multiple --include and --exclude conditions. ossutil evaluates conditions from left to right to determine the final result. For example, given a test.txt object in the target directory:
Rule 1:
--include "*test*" --exclude "*.txt"ossutil first evaluates--include "*test*"and includestest.txtbecause it matches. Then ossutil evaluates--exclude "*.txt"and excludestest.txtbecause it matches*.txt. Result: excluded.Rule 2:
--exclude "*.txt" --include "*test*"ossutil first evaluates--exclude "*.txt"and excludestest.txt. Then ossutil evaluates--include "*test*"and includestest.txtbecause it matches. Result: included.Rule 3:
--include "*test*" --exclude "*.txt" --include "te?t.txt"ossutil evaluates--include "*test*"(included), then--exclude "*.txt"(excluded), then--include "te?t.txt"(included). Result: included.
Wildcard patterns
| Pattern | Description | Example |
|---|---|---|
* | Matches any number of characters. | *.txt matches all TXT files. |
? | Matches a single character. | abc?.jpg matches abc1.jpg, abcX.jpg, etc. |
[sequence] | Matches any character in the sequence. | abc[1-5].jpg matches abc1.jpg through abc5.jpg. |
[!sequence] | Matches any character not in the sequence. | abc[!0-7].jpg matches objects like abc8.jpg and abc9.jpg, but not abc0.jpg through abc7.jpg. |
Limitations
Directory paths cannot be specified in --include or --exclude patterns. For example, the following command produces the error --include or --exclude does not support format containing dir info:
ossutil cp oss://examplebucket/destfolder/ localfolder/ --include "dir/"