rclone hashsum

rclone hashsum

为路径中的所有对象生成哈希和文件。

概要

使用指定的哈希算法为路径中的所有对象生成哈希文件。输出格式与标准的 md5sum/sha1sum 工具相同。

默认情况下,会从远程请求哈希值。如果远程不支持该哈希算法,则不会返回哈希值。使用 --download 标志时,文件将从远程下载并在本地进行哈希计算,这样就可以为任何远程对象使用任何哈希算法。

对于 MD5 和 SHA1 算法,还有专门的命令:md5sumsha1sum

此命令还可以对从标准输入(stdin)接收的数据进行哈希计算,方法是不传递 remote:path,或者在有数据可读时将连字符(-)作为 remote:path 传递(如果没有数据可读,连字符将被视为相对路径)。

不指定哈希算法运行该命令,以查看所有支持的哈希算法列表,例如:

    $ rclone hashsum
    Supported hashes are:
      * md5
      * sha1
      * whirlpool
      * crc32
      * sha256

Then

    $ rclone hashsum MD5 remote:path

请注意,哈希名称不区分大小写,而值则以小写输出。

rclone hashsum [ remote:path] [flags]


## Options
  --base64               Output base64 encoded hashsum

-C, –checkfile string Validate hashes against a given SUM file instead of printing them –download Download the file and hash it locally; if this flag is not specified, the hash is requested from the remote -h, –help help for hashsum –output-file string Output hashsums to a file rather than the terminal


接下来将介绍与其他命令共享的选项。
此处未列出的全局选项,请参阅[全局标志页面](/flags/)。

### 过滤器选项

用于过滤目录列表的标志
  --delete-excluded                     删除目标端中被排除在同步之外的文件
  --exclude stringArray                 排除符合指定模式的文件
  --exclude-from stringArray            从文件中读取要排除的文件模式(使用 - 从标准输入读取)
  --exclude-if-present stringArray      如果指定文件名存在,则排除该目录
  --files-from stringArray              从文件中读取源文件名列表(使用 - 从标准输入读取)
  --files-from-raw stringArray          从文件中读取源文件名列表,不对行进行任何处理(使用 - 从标准输入读取)

-f, –filter stringArray 添加文件过滤规则 –filter-from stringArray 从文件中读取文件过滤模式(使用 - 从标准输入读取) –ignore-case 在过滤时忽略大小写(大小写不敏感) –include stringArray 包含符合指定模式的文件 –include-from stringArray 从文件中读取要包含的文件模式(使用 - 从标准输入读取) –max-age Duration 仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更新的文件(默认关闭) –max-depth int 如果设置,则将递归深度限制为此值(默认 -1) –max-size SizeSuffix 仅传输小于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭) –metadata-exclude stringArray 排除符合指定模式的元数据 –metadata-exclude-from stringArray 从文件中读取要排除的元数据模式(使用 - 从标准输入读取) –metadata-filter stringArray 添加元数据过滤规则 –metadata-filter-from stringArray 从文件中读取元数据过滤模式(使用 - 从标准输入读取) –metadata-include stringArray 包含符合指定模式的元数据 –metadata-include-from stringArray 从文件中读取要包含的元数据模式(使用 - 从标准输入读取) –min-age Duration 仅传输比指定时间(以秒或后缀 ms|s|m|h|d|w|M|y 表示)更旧的文件(默认关闭) –min-size SizeSuffix 仅传输大于指定大小(以 KiB 或后缀 B|K|M|G|T|P 表示)的文件(默认关闭)


### Listing Options

Flags for listing directories
  --default-time Time   Time to show if modtime is unknown for files and directories (default 2000-01-01T00:00:00Z)
  --fast-list           Use recursive list if available; uses more memory but fewer transactions

## 参见

* [rclone](/commands/rclone/) - 显示 rclone 命令、标志和后端帮助。