hash
command is used to calculate the hash value of a local file or get the hash value of a file in COS../coscli hash <object-name> [flag]
hash
includes the following parameters:Parameter Format | Description | Example |
<object-name> | Specifies the target file, which can be a local path or a COS file path. The COS path is accessible by using the bucket alias or bucket name configured in the configuration file as detailed in Download and Installation Configuration. If you use the bucket name for access, you also need to include the endpoint flag. | Local path: ~/example.txt COS file path specified with the bucket alias: cos://bucketalias/example.txt COS file path specified with the bucket name: cos://examplebucket-1250000000/example.txt |
hash
command contains the following optional flags:Flag Abbreviation | Flag Name | Description |
-h | --help | Views the usage of this command. |
None | --type | Hash type, which can be MD5 or CRC64 (default) |
./coscli hash ~/test.txt
./coscli hash cos://bucket1/example.txt --type=md5
Was this page helpful?