Run ossutil -h to list all supported command-line options.
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:
|
|
--proxy-host, --proxy-user, --proxy-pwd |
Proxy configuration options:
After configuration, ossutil routes traffic through the proxy.
|
|
--mode |
The type of credential. Valid values:
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, Default STS endpoint in RamRoleArn mode: |
|
--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.
|
|
--all-versions |
Specifies all versions of an object. |
|
--type |
The data validation method. Valid values:
|
|
-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:
|
|
--sse-algorithm |
The server-side encryption algorithm for the bucket. Valid values:
|
|
--include |
Lists objects that meet the specified conditions. For example, |
|
--exclude |
Lists objects that do not meet the specified conditions. For example, |
|
-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: |
|
--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: |
|
--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:
|
|
--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 |
|
--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.
|
|
--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:
|
|
-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: |
|
--bucketname |
The bucket name. |
|
--encoding-type |
URL-encodes the object key after |
|
--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, |
|
--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:
|
|
--redundancy-type |
The data redundancy type of the bucket. Valid values:
|
|
--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: |
|
--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.